fireman_gcfd
Registered User.
- Local time
- Today, 15:14
- Joined
- Aug 14, 2007
- Messages
- 25
Hello everyone. I am having a little difficulty in finding out exactly where I went wrong with this script. Everything works...sort of. The idea of it was to email a Single record. When clicking the button it wants to send All the reports. I am able to generate a report showing only one record, but trying to get the same thing but prepare it for email does not seem to be working.
Here is my code...can you see where I went wrong?
Private Sub Command304_Click()
On Error GoTo Err_Command304_Click
Dim strWhere As String
Dim stDocName As String
stDocName = "MyReport"
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to email"
Else
MyForm = "[Incident] = """ & Me.[Incident] & """"
DoCmd.SendObject acReport, "MyReport", "Snapshot Format", , , , "My email Report " & Me.[Date]
Exit_Command304_Click:
Exit Sub
Err_Command304_Click:
MsgBox Err.Description
Resume Exit_Command304_Click
End If
End Sub
Thanks again
Jaz
Here is my code...can you see where I went wrong?
Private Sub Command304_Click()
On Error GoTo Err_Command304_Click
Dim strWhere As String
Dim stDocName As String
stDocName = "MyReport"
If Me.Dirty Then 'Save any edits.
Me.Dirty = False
End If
If Me.NewRecord Then 'Check there is a record to print
MsgBox "Select a record to email"
Else
MyForm = "[Incident] = """ & Me.[Incident] & """"
DoCmd.SendObject acReport, "MyReport", "Snapshot Format", , , , "My email Report " & Me.[Date]
Exit_Command304_Click:
Exit Sub
Err_Command304_Click:
MsgBox Err.Description
Resume Exit_Command304_Click
End If
End Sub
Thanks again
Jaz