Hi,
I'm new to access.
I have created a form that is bound to a table.
There is a button on the form that allows users to send email with the form as an attachment in pdf. I'd like to create a date/time stamp in another table called tblLog. Trouble is the code works uptil sending emails but it doesn't record the stamp.
Heres what I've done so far. Any help would be greatly appreciated
----------
Private Sub cmdEmail_Amd_Click()
On Error GoTo cmdEmail_Amd_Click_Err
DoCmd.OpenForm "frmAmendment_Master", , , "[Record_ID]=" & Me.Record_ID.Value
DoCmd.SendObject acForm, "frmAmendment_Master", "PDFFormat(*.pdf)", "", "", "", "Amendment Form" & " " & Surname & " " & Firstname, "", True, ""
cmdEmail_Amd_Click_Exit:
Exit Sub
cmdEmail_Amd_Click_Err:
MsgBox ("Email Operation Cancelled")
Resume cmdEmail_Amd_Click_Exit
Dim dbLog As DAO.Database
Dim LogRec As DAO.Recordset
Set dbLog = CurrentDb
Set LogRec = dbLog.OpenRecordset("tblLog")
LogRec.AddNew
LogRec("eDate").Value = Date
LogRec("eTime") = Format(Now, "Long Time")
LogRec("Form").Value = "frmAmendment_Master"
LogRec("User").Value = Me.[User Assignment_Amd].Value
LogRec("Detail").Value = User & "Opened Form"
LogRec.Update
End Sub
I'm new to access.
I have created a form that is bound to a table.
There is a button on the form that allows users to send email with the form as an attachment in pdf. I'd like to create a date/time stamp in another table called tblLog. Trouble is the code works uptil sending emails but it doesn't record the stamp.
Heres what I've done so far. Any help would be greatly appreciated
----------
Private Sub cmdEmail_Amd_Click()
On Error GoTo cmdEmail_Amd_Click_Err
DoCmd.OpenForm "frmAmendment_Master", , , "[Record_ID]=" & Me.Record_ID.Value
DoCmd.SendObject acForm, "frmAmendment_Master", "PDFFormat(*.pdf)", "", "", "", "Amendment Form" & " " & Surname & " " & Firstname, "", True, ""
cmdEmail_Amd_Click_Exit:
Exit Sub
cmdEmail_Amd_Click_Err:
MsgBox ("Email Operation Cancelled")
Resume cmdEmail_Amd_Click_Exit
Dim dbLog As DAO.Database
Dim LogRec As DAO.Recordset
Set dbLog = CurrentDb
Set LogRec = dbLog.OpenRecordset("tblLog")
LogRec.AddNew
LogRec("eDate").Value = Date
LogRec("eTime") = Format(Now, "Long Time")
LogRec("Form").Value = "frmAmendment_Master"
LogRec("User").Value = Me.[User Assignment_Amd].Value
LogRec("Detail").Value = User & "Opened Form"
LogRec.Update
End Sub