Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2003

    Unhappy Unanswered: Fill in e-mail address from the table?

    I have a macro that will send the e-mail to a recipient but you have to type in the TO e-mail address. i am storing the address already in one of my tables, how can I have it automatically fill it in from the table of the selected record?


  2. #2
    Join Date
    Dec 2004
    Madison, WI
    It would be much easier with vba coding (ie. in the OnClick event of a button). You could have code as such:

    Dim EmailTo as variant
    EmailTo = dlookup("[EmailAddressField]","MyTableName","[UserNameField] = '" & Forms!MyFormName!UserNameField & "'")
    DoCmd.SendObject , , , EmailTo, , , "This is the subject", "This is the message", True
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts