Fredgarner
Technical User
I would like to deisgn a form which gives the option of printing or previewing (ie 2 choices = 2 command buttons)a choice of 3 reports (ie 3 choices). I would like to be able to highlight the report I want to print by using 3 option buttons - I know how to create a command button that either prints or previews a report, but not how to use the option buttons to link these 2 command buttons to 3 separate reports. At the moment I am having to use 6 command buttons for this operation.
Somsbody kindly posted this reply, but as I have not done this before I have no idea where the suggested code should go in the Command Button formula.
You can reference the variable of the option group and code within the command button an If Statement... ie.
If Opt_Reports = 1 Then
lcReportName = "ReportName1"
ElseIf Opt_Reports = 2 Then
lcReportName = "ReportName2"
ElseIf Opt_Reports = 3 Then
lcReportName = "ReportName3"
Else
lcReportName = "" 'Force Error
End If
Once you have variable, use that when calling either print of preview.. hthw,
Somsbody kindly posted this reply, but as I have not done this before I have no idea where the suggested code should go in the Command Button formula.
You can reference the variable of the option group and code within the command button an If Statement... ie.
If Opt_Reports = 1 Then
lcReportName = "ReportName1"
ElseIf Opt_Reports = 2 Then
lcReportName = "ReportName2"
ElseIf Opt_Reports = 3 Then
lcReportName = "ReportName3"
Else
lcReportName = "" 'Force Error
End If
Once you have variable, use that when calling either print of preview.. hthw,