S
Steve Stad
I have a button on a form to open a report based on a parameter query. The
button activates the parameter query and the parameter msgbox says enter MIL
or CIV. I would like to ensure the user spells MIL or CIV correctly so the
parameter query runs correctly everytime. The current button code is below.
Can you tell me how to add/edit or redo code to force user to spell MIL or
CIV correctly. For example with if statement ..If input box <> "CIV" and
inputbox <> "MIL" then msgbox "You Must spell MIL or CIV correctly"
Private Sub MILCIVPercentCompRep_Click()
On Error GoTo Err_MILCIVPercentCompRep_Click
Dim stDocName As String
stDocName = "Rep_CompletenessMIL&CIVPerc"
DoCmd.OpenReport stDocName, acPreview
Exit_MILCIVPercentCompRep_Click:
Exit Sub
Err_MILCIVPercentCompRep_Click:
MsgBox Err.Description
Resume Exit_MILCIVPercentCompRep_Click
End Sub
button activates the parameter query and the parameter msgbox says enter MIL
or CIV. I would like to ensure the user spells MIL or CIV correctly so the
parameter query runs correctly everytime. The current button code is below.
Can you tell me how to add/edit or redo code to force user to spell MIL or
CIV correctly. For example with if statement ..If input box <> "CIV" and
inputbox <> "MIL" then msgbox "You Must spell MIL or CIV correctly"
Private Sub MILCIVPercentCompRep_Click()
On Error GoTo Err_MILCIVPercentCompRep_Click
Dim stDocName As String
stDocName = "Rep_CompletenessMIL&CIVPerc"
DoCmd.OpenReport stDocName, acPreview
Exit_MILCIVPercentCompRep_Click:
Exit Sub
Err_MILCIVPercentCompRep_Click:
MsgBox Err.Description
Resume Exit_MILCIVPercentCompRep_Click
End Sub