Public function

B

Bob

I am using the SendOBject to send a report from a form. Instead of hard
coding the email address into the VBA I would like to have those addresses
pulled from a table based on 1 of the fields in the form. I thought that I
would be able to do this by creating a function that would select the values
that I wanted. I would like to call a Public Function which has the select
statement in it and then insert that Public Function into the SendObject line
in the form. The reason is that if the email addresses for the distribution
change I will not have to change the code I would only have to change the
values in the table/form.
 
K

Kevin

Bob,

Are you sending one e-mail at a time from a form with the message recipient
record the active record in a form? If so, you can pull the e-mail address
straight from the form. It is also possible to use a select query in VBA and
get the information that way. If you don't want your user to see the E-Mail
address from that screen, place the field on the form and make it invisible.

Hope that helps! If you need more help, post back.

Kevin
 
B

Bob

Yes I would like to have VBA use a query in a function but have not been able
to get it to work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top