Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Clicking a button to e-mail 1

Status
Not open for further replies.

PaulMThomas

IS-IT--Management
Aug 2, 2004
133
GB
Please excuse my terminology as I am new to Access!

I have created a button on a form which will allow the user to send an e-mail.

The form displays data from a Hotline Call table and has a couple of queries, it allows you to select entreies from 3 seperate tables (Customer, Site and Contact which are all related)

How do I assign a variable with the value of the e-mail address field contained within the contact table details so that I can pass this to the procedure that launches a new e-mail? (The difficulty seems to be that the Contact table is not the primary table on the form but a query)

 
Is the contact table query the record source for a subform?
 
Hi

There are no subforms on this form.

The user selects the Customer from a drop down box which uses a query. Then the Site from another drop down box with a query and finally the contact name from a 3rd drop down box.

I have modified the properties so that it show's the selected contact name and the e-mail address in brackets on screen but I don't know how to get this data into a variable.
 
Hiya, PaulMThomas,

Sounds like you need to use column notation.
Code:
Dim strEmail As String
strEmail = Me![blue]MyComboBox[/blue].Column([red]X[/red])
...where the text in blue is the name of YOUR combobox control, and the red X is the appropriate column from said combobox. Column notation is zero-based, so the first column is Column(0), second column is Column(1), and so on.

HTH,

Ken S.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top