E
ElPresidente
Hi everyone,
I have several reports which are accessed through a form that allows
the user to specify a date range. The form also allows the user to
either view the report, print the report, or export it to PDF. Since
all the reports would have the identical form, I thought it would be
best to have one form, and have the "Run Report" button pull up the
correct report based on the one that was selected from the
switchboard. So I wrote the following code:
If (reportOptions = 1) Then
DoCmd.OpenReport reportName, acViewPreview, "", "", acNormal
End If
I'm still new to VBA so maybe I'm not writing this expression
correctly. The variable is a string name such as mthlyCustomers. If I
replace reportName with "mthlyCustomers" the report opens. What is the
workaround for this or do I have to create several identical forms?
I have several reports which are accessed through a form that allows
the user to specify a date range. The form also allows the user to
either view the report, print the report, or export it to PDF. Since
all the reports would have the identical form, I thought it would be
best to have one form, and have the "Run Report" button pull up the
correct report based on the one that was selected from the
switchboard. So I wrote the following code:
If (reportOptions = 1) Then
DoCmd.OpenReport reportName, acViewPreview, "", "", acNormal
End If
I'm still new to VBA so maybe I'm not writing this expression
correctly. The variable is a string name such as mthlyCustomers. If I
replace reportName with "mthlyCustomers" the report opens. What is the
workaround for this or do I have to create several identical forms?