I am working on a database for measurement requests and i want the database to send an email to the administrator when a button is pressed. I can get everything to work apart from getting the database to look up the name of the admin in a seperate table.
I have been using the following code for a slightly different email, one which sends a message to the originator of the request but this code looks at the requestor id box on the form. How do i make it look at the "Administrators" table, "admin1" field instead?
Private Sub BTN_SAVESEND_Click()
On Error GoTo Err_BTN_SAVESEND_Click
strto = Me.Requestor_CDS_ID_
DoCmd.SendObject , , , strto & "@companyname.com", , , "Your Metrology Request: Job Number " & Me![Job number:] & " has been received.", "Your request will be completed as soon as possible and you will be notified by email when it is completed. ", False
Exit_BTN_SAVESEND_Click:
Exit Sub
Err_BTN_SAVESEND_Click:
MsgBox Err.Description
Resume Exit_BTN_SAVESEND_Click
End Sub
Any help would be greatly appreciated!
I have been using the following code for a slightly different email, one which sends a message to the originator of the request but this code looks at the requestor id box on the form. How do i make it look at the "Administrators" table, "admin1" field instead?
Private Sub BTN_SAVESEND_Click()
On Error GoTo Err_BTN_SAVESEND_Click
strto = Me.Requestor_CDS_ID_
DoCmd.SendObject , , , strto & "@companyname.com", , , "Your Metrology Request: Job Number " & Me![Job number:] & " has been received.", "Your request will be completed as soon as possible and you will be notified by email when it is completed. ", False
Exit_BTN_SAVESEND_Click:
Exit Sub
Err_BTN_SAVESEND_Click:
MsgBox Err.Description
Resume Exit_BTN_SAVESEND_Click
End Sub
Any help would be greatly appreciated!