D
deb
I have an option group called grpPM on a form. The option group has 3
choices opt1, opt2, opt3)
I also have a report buttons(btnSales). Below is the code behind the button.
I would like to be able to revise the code, and when one of the opt group is
selected the corresponding report is opened.
How can I revise the below to make it work.
Private Sub Command41_Click()
On Error GoTo Err_Command41_Click
Dim stDocName As String
if opt1 is chosen then
stDocName = "rSalesMaster"
if opt2 is chosen then
stDocName = "rAreaMaster"
if opt3 is chosen then
stDocName = "rCombinedMaster"
DoCmd.OpenReport stDocName, acPreview
Exit_Command41_Click:
Exit Sub
Err_Command41_Click:
MsgBox Err.Description
Resume Exit_Command41_Click
choices opt1, opt2, opt3)
I also have a report buttons(btnSales). Below is the code behind the button.
I would like to be able to revise the code, and when one of the opt group is
selected the corresponding report is opened.
How can I revise the below to make it work.
Private Sub Command41_Click()
On Error GoTo Err_Command41_Click
Dim stDocName As String
if opt1 is chosen then
stDocName = "rSalesMaster"
if opt2 is chosen then
stDocName = "rAreaMaster"
if opt3 is chosen then
stDocName = "rCombinedMaster"
DoCmd.OpenReport stDocName, acPreview
Exit_Command41_Click:
Exit Sub
Err_Command41_Click:
MsgBox Err.Description
Resume Exit_Command41_Click