My database contains the following code that saves the record and sends a report by email as an attached file using the SendObject command.
My problem is that the database runs this code onceperfectly, and then it wont run it again. i have to close and reopen the database in order to get it to work again.
Any help would be most appreciated. This my first attempt at writing code so please explain things simply.
Many, many thanks, Jon.N
Private Sub Cmd103_Click()
On Error GoTo Err_Cmd103_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim stDocName As String
DoCmd.SendObject acSendReport, "SendSample", acFormatRTF, , , Me.BCCemail, "XYZ Form", "The attached Release Form has been prepared as an RTF file. Most word processors and many other applications can read this format.", True
Exit_Cmd103_Click:
Exit Sub
Err_Cmd103_Click:
MsgBox Err.Description
Resume Exit_Cmd103_Click
End Sub
My problem is that the database runs this code onceperfectly, and then it wont run it again. i have to close and reopen the database in order to get it to work again.
Any help would be most appreciated. This my first attempt at writing code so please explain things simply.
Many, many thanks, Jon.N
Private Sub Cmd103_Click()
On Error GoTo Err_Cmd103_Click
DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70
Dim stDocName As String
DoCmd.SendObject acSendReport, "SendSample", acFormatRTF, , , Me.BCCemail, "XYZ Form", "The attached Release Form has been prepared as an RTF file. Most word processors and many other applications can read this format.", True
Exit_Cmd103_Click:
Exit Sub
Err_Cmd103_Click:
MsgBox Err.Description
Resume Exit_Cmd103_Click
End Sub