M
Michael Firey
I use a button on a form to run a report. I now want to use the
button to run a choice of reports based on what the clientID field
value is. For example, if the clientID field is 866, I want it to run
a report called FireytechWO. If the clientID field value is 845, I
want it to run a report called NewcorpWO. Below is the code I
currently use for the button. What do I need to do to make the code
run the above choices?
Private Sub FireytechWO_Click()
On Error GoTo Err_FireytechWO_Click
If Me.Dirty Then Me.Dirty = False
If Me.Dirty Then RunCommand acCmdSaveRecord
Dim strDocName As String
Dim strWhere As String
strDocName = "FireytechWO"
strWhere = "[ticketnumber] = " & "" & Me.TicketNumber & ""
DoCmd.OpenReport strDocName, acPreview, , strWhere
Exit_FireytechWO_Click:
Exit Sub
Err_FireytechWO_Click:
MsgBox Err.Description
Resume Exit_FireytechWO_Click
End Sub
button to run a choice of reports based on what the clientID field
value is. For example, if the clientID field is 866, I want it to run
a report called FireytechWO. If the clientID field value is 845, I
want it to run a report called NewcorpWO. Below is the code I
currently use for the button. What do I need to do to make the code
run the above choices?
Private Sub FireytechWO_Click()
On Error GoTo Err_FireytechWO_Click
If Me.Dirty Then Me.Dirty = False
If Me.Dirty Then RunCommand acCmdSaveRecord
Dim strDocName As String
Dim strWhere As String
strDocName = "FireytechWO"
strWhere = "[ticketnumber] = " & "" & Me.TicketNumber & ""
DoCmd.OpenReport strDocName, acPreview, , strWhere
Exit_FireytechWO_Click:
Exit Sub
Err_FireytechWO_Click:
MsgBox Err.Description
Resume Exit_FireytechWO_Click
End Sub