All,
I have the following code that works fine for some other function, but I would also like to have certain fields from a current record appear in the email. Do anyone know the code that could be tacked on to the below code? The email I have is at the bottom of the code.
Private Sub Command3_Click()
On Error GoTo Err_Command3_Click
Dim db As DAO.Database, rst As DAO.Recordset
'Copy Record and Save Record to new table
Set db = CurrentDb
Set rst = db.OpenRecordset("MyTableName"
rst.AddNew
rst!field1 = Me!field1
rst!field2 = Me!field2
rst!field3 = Me!field3
rst.Update
rst.Close
db.Close
'send e-mail
DoCmd.SendObject acSendNoObject, "", acFormatTXT, "MyEmailAddress",,,"Subject Here", "message", True
Exit_Command3_Click:
Exit Sub
Err_Command3_Click:
MsgBox Err.Description
Resume Exit_Command3_Click
End Sub
I hope someone can help with the ending code. Thanks bunches!!!
I have the following code that works fine for some other function, but I would also like to have certain fields from a current record appear in the email. Do anyone know the code that could be tacked on to the below code? The email I have is at the bottom of the code.
Private Sub Command3_Click()
On Error GoTo Err_Command3_Click
Dim db As DAO.Database, rst As DAO.Recordset
'Copy Record and Save Record to new table
Set db = CurrentDb
Set rst = db.OpenRecordset("MyTableName"
rst.AddNew
rst!field1 = Me!field1
rst!field2 = Me!field2
rst!field3 = Me!field3
rst.Update
rst.Close
db.Close
'send e-mail
DoCmd.SendObject acSendNoObject, "", acFormatTXT, "MyEmailAddress",,,"Subject Here", "message", True
Exit_Command3_Click:
Exit Sub
Err_Command3_Click:
MsgBox Err.Description
Resume Exit_Command3_Click
End Sub
I hope someone can help with the ending code. Thanks bunches!!!