Quote:
Originally Posted by Monroeski
I am working on a form for approval/disapproval of requests. Basically, the user will select a RequestID from a combobox, then select approve or disapprove, then hit the submit button. When they hit submit, I want to
1. Update the DB (which I have already implemented), then
2. using the RequestID, determine the two related email addresses (let's say Email1 and Email2) attached to the relevant ServiceID.
This sounds odd to me, but though I have done a good number of update queries, select queries to populate combo boxes, and a few other things, I haven't had to pull a particular field value from a query individually before and I'm not totally sure where to start.
I have no trouble putting together the actual SQL queries and everything, I'm just not sure how to manipulate the data to pull those two email addresses out individually.
Hi,
So your SQL would be something like
- SELECT ServiceTable.Email1, ServiceTable.Email2
-
FROM RequestTable INNER JOIN ServiceTable ON RequestTable.RequestID = ServiceTable.ServiceTableForeignKey
-
WHERE RequestTable.RequestID = <the combo-box selection>
and you open a recordset (rs) based on that SQL
You then reference the Email addresses by
rs!Email1 and rs!Email2
And the bit you didn't ask, but is obvious from the title, you then use the SendObject method of the DoCmd object (watch the second-last option of the SendObject method, Edit or not edit, some network security settings get scared if you try to send email programatically without opening the email client.
Good luck and ask again if you need.
Jim