Public function

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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.
 
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
 
Yes I would like to have VBA use a query in a function but have not been able
to get it to work.
 
Back
Top