G
Guest
I have several forms that use the same parameter query to open a report.
From the form I want to send three parameters to a query to generate the
report, however, I do not want to specify the form as the forms could be
different. In what format do I send the parameters, and how do I set up the
query to accept the parameters that I am sending. I use a button to create
the report and set the three criteria I need to send to the query.
So far I have tried
Dim ProjNum As String
Dim VenNum As String
Dim RevuDt As Date
ProjNum = Me.ProjectID
VenNum = Me.VendorID
RevuDt = Me.ReviewDate
If Me.OSHA1 > 0 Or Me.OSHA2 > 0 Or Me.OSHA3 > 0 Or Me.OSHA4 > 0 Or Me.OSHA5
& [VendorID] = VenNum & ";" & [ReviewDate] = RevuDt, acNormal
End If
But this does not work. (Be gentle I am just learning)
I have no idea what to put in the query for criteria. Everything I read
says base it on the form, but I can't because different forms use the query.
Also, I have 51 different buttons to create 51 different reports or I would
create duplicate queries for the different forms.
Any and all help would be aprreciated!!!
Thanks in advance.
From the form I want to send three parameters to a query to generate the
report, however, I do not want to specify the form as the forms could be
different. In what format do I send the parameters, and how do I set up the
query to accept the parameters that I am sending. I use a button to create
the report and set the three criteria I need to send to the query.
So far I have tried
Dim ProjNum As String
Dim VenNum As String
Dim RevuDt As Date
ProjNum = Me.ProjectID
VenNum = Me.VendorID
RevuDt = Me.ReviewDate
If Me.OSHA1 > 0 Or Me.OSHA2 > 0 Or Me.OSHA3 > 0 Or Me.OSHA4 > 0 Or Me.OSHA5
DoCmd.OpenReport "OSHArptProj", acviewPrint, "", [ProjectID] = ProjNum & ";"0 Then
& [VendorID] = VenNum & ";" & [ReviewDate] = RevuDt, acNormal
End If
But this does not work. (Be gentle I am just learning)
I have no idea what to put in the query for criteria. Everything I read
says base it on the form, but I can't because different forms use the query.
Also, I have 51 different buttons to create 51 different reports or I would
create duplicate queries for the different forms.
Any and all help would be aprreciated!!!
Thanks in advance.