Question Auto fill and Multiple values fields!!!!

AsMok

IT IS ME ^_^
Local time
Yesterday, 20:15
Joined
Sep 4, 2019
Messages
67
Hi all

I designed an entry form to enter data and have a button to send an email to different addresses... i faced two problems(this post for the first one):::-

----------------------
To choose names I use combo box related to a table with two columns (the name and the email address,,,,)and i store the receiver name through it in the main table.

The email addresses field is auto filled from the (after update event of the previous combo box ...... by( Emails = Names.Column(2)....)

things is OK if i choose one name BUT choosing more than one makes the field empty..

how can i solve that??
I need all the addresses to send the same email

Thanks in advance
 
Hi. Can you post the code you're using in your AfterUpdate event? Thanks.
 
Emails = Names.Column(2)

I use Microsoft Access 2013
for one name the code is OK
but choosing multiple the problem appears ;;;;blank emails field :(
 
Okay. Try this one for starters:
Code:
Emails = Emails & ";" & Names.Column(2)

--------------------------

Choosing one name the email still appears in the emails field,,,,,,
BUt
more only ; sign appears in the field...
 
--------------------------

Choosing one name the email still appears in the emails field,,,,,,
BUt
more only ; sign appears in the field...
Hmm, it's hard to say why. Can you post a small copy of your db instead?
 
Hmm, it's hard to say why. Can you post a small copy of your db instead?
------
OK
I have some queries>>>
Can combo box field be auto filled?
does text fields accept multiple values?
should both the form bounded field and the table field be combo boxes ?
 
------
OK
I have some queries>>>
Can combo box field be auto filled?
does text fields accept multiple values?
should both the form bounded field and the table field be combo boxes ?
To get some context to go with your questions, we'll need more information about what you're trying to do. Posting a sample db will help us understand your questions better.
 
I created now this simple DB with the same code and problem.....
can not send the original one because i entered some company data as a test

hope that will be ok
 

Attachments

I created now this simple DB with the same code and problem.....
can not send the original one because i entered some company data as a test

hope that will be ok
Hi. Thanks. I don't have a whole lot of time to work on it, but here's what I came up with for the moment. Hope it helps...
 

Attachments

Hi. Thanks. I don't have a whole lot of time to work on it, but here's what I came up with for the moment. Hope it helps...
----
many many many .... thanks DBguy

I will test it tomorrow with the real data and tell u the result

another huge thanks :)
 
----
many many many .... thanks DBguy

I will test it tomorrow with the real data and tell u the result

another huge thanks :)
Hi. You're welcome. Let us know how it goes.
 
Hi. You're welcome. Let us know how it goes.

------
for sure
now it is 11:00 pm

tomorrow morning will be the real test :) and the final answer
and will switch to the second problem ;)

Many Thanks & BEST OF LUCK
 
Hi. You're welcome. Let us know how it goes.
----
hi again

thanks for your help
first, i imported the module and the code to my real DB and modified it regarding the form and table names But it did not work...( for sure i did sth wrong :) ).....

Then I did the opposite :rolleyes: I exported the forms and tabled i need to meetings DB and did some modifications to the other fields and design issues now is OK and the code is working ....GREAT,,,,

MANY THANKS
 
theDBGuy didn't mention what he changed and I can't download both databases and compare them so I'll just say - if you are using a multi-select listbox, it isn't bound and so you cannot simply refer to its value property and expect to see a string of selected items. You need to loop through the items collection and find all the selected items and create an In() clause so you end up with:

Where somefield In(optionA, OptionB, Optionc)
----
the code is working well to show all the email addresses.....

but when I send the email and choose more than one email address i face a problem
i discuss this point at this post
v
v
https://www.access-programmers.co.uk/forums/showthread.php?t=306736
 

Users who are viewing this thread

Back
Top Bottom