L
Leslie Isaacs
Hello All
I have a button on a form that is used to preview a particular report.
I would like to give the user the ability to select one of three reports,
after clicking the button.
I have in mind something like:
Private Sub Command71_Click()
On Error GoTo Err_Command71_Click
Dim stDocName As String
If [Print which letter - enter 1 ,2 or 3] =1 Then
stDocName = "rpt_letter_1"
DoCmd.OpenReport stDocName, acPreview
Else
If [Print which letter - enter 1 ,2 or 3] =2 Then
stDocName = "rpt_letter_2"
DoCmd.OpenReport stDocName, acPreview
Else
stDocName = "rpt_letter_3"
DoCmd.OpenReport stDocName, acPreview
End If
End If
Exit_Command71_Click:
Exit Sub
Err_Command71_Click:
MsgBox Err.Description
Resume Exit_Command71_Click
End Sub
.... but I find that I cannot have the user enter the parameter value [Print
which letter - enter 1 ,2 or 3] like I would in a query.
So how do I do it?
Hope someone can help.
Many thanks
Leslie Isaacs
I have a button on a form that is used to preview a particular report.
I would like to give the user the ability to select one of three reports,
after clicking the button.
I have in mind something like:
Private Sub Command71_Click()
On Error GoTo Err_Command71_Click
Dim stDocName As String
If [Print which letter - enter 1 ,2 or 3] =1 Then
stDocName = "rpt_letter_1"
DoCmd.OpenReport stDocName, acPreview
Else
If [Print which letter - enter 1 ,2 or 3] =2 Then
stDocName = "rpt_letter_2"
DoCmd.OpenReport stDocName, acPreview
Else
stDocName = "rpt_letter_3"
DoCmd.OpenReport stDocName, acPreview
End If
End If
Exit_Command71_Click:
Exit Sub
Err_Command71_Click:
MsgBox Err.Description
Resume Exit_Command71_Click
End Sub
.... but I find that I cannot have the user enter the parameter value [Print
which letter - enter 1 ,2 or 3] like I would in a query.
So how do I do it?
Hope someone can help.
Many thanks
Leslie Isaacs