fireman_gcfd
Registered User.
- Local time
- Today, 14:44
- Joined
- Aug 14, 2007
- Messages
- 25
Hey all,
I have a command button that opens a report from a record. The idea behind it, it to open a report and select the current record. The criteria is based on the "Incident" number. Now for what ever reason I am getting an error about mismatched criteria yet if I select the field of "Captain in Charge" it will generate the report but ALL records with that captain's name in it. Anyway, here is the code I have in place...can anyone see where I am going wrong?
Any and all help would be appreciated.
Thanks
Jaz
I have a command button that opens a report from a record. The idea behind it, it to open a report and select the current record. The criteria is based on the "Incident" number. Now for what ever reason I am getting an error about mismatched criteria yet if I select the field of "Captain in Charge" it will generate the report but ALL records with that captain's name in it. Anyway, here is the code I have in place...can anyone see where I am going wrong?
Code:
Private Sub Command303_Click()
Dim strWhere As String
If Me.Dirty Then
Me.Dirty = False
End If
If Me.NewRecord Then
MsgBox "Select a record to print"
Else
strWhere = "[Incident] = """ & Me.[Incident] & """"
DoCmd.OpenReport "HorizonResponseReport", acViewPreview, , strWhere
End If
End Sub
Any and all help would be appreciated.
Thanks
Jaz