mkelly
Registered User.
- Local time
- Yesterday, 18:31
- Joined
- Apr 10, 2002
- Messages
- 213
This is the code I have on a form to open a reportt based on ehat is choosen in a list box....
Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
If Text2 = "1" Then
DoCmd.OpenReport First_class_permit_report, acViewPreview, , , acWindowNormal
Else
If Text2 = "2" Then
DoCmd.OpenReport General_707 - 6 - 2, acViewPreview, , , acWindowNormal
Else
If Text2 = "3" Then
DoCmd.OpenReport Meter_Mail_Report, acViewPreview, , , acWindowNormal
Else
If Text2 = "4" Then
DoCmd.OpenReport nonprofit_permit_report, acViewPreview, , , acWindowNormal
Else
If Text2 = "5" Then
DoCmd.OpenReport precancelled_mail_permit_report, acViewPreview, , , acWindowNormal
Else
If Text2 = "6" Then
DoCmd.OpenReport pub_only_707 - 6 - 2, acViewPreview, , , acWindowNormal
Else
If Text2 = "7" Then
DoCmd.OpenReport Standard_mail_report, acViewPreview, , , acWindowNormal
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
End If
End Sub
When I click the button I get an error of "Block If without End If"
What is the right command to end this??
Private Sub Command5_Click()
On Error GoTo Err_Command5_Click
If Text2 = "1" Then
DoCmd.OpenReport First_class_permit_report, acViewPreview, , , acWindowNormal
Else
If Text2 = "2" Then
DoCmd.OpenReport General_707 - 6 - 2, acViewPreview, , , acWindowNormal
Else
If Text2 = "3" Then
DoCmd.OpenReport Meter_Mail_Report, acViewPreview, , , acWindowNormal
Else
If Text2 = "4" Then
DoCmd.OpenReport nonprofit_permit_report, acViewPreview, , , acWindowNormal
Else
If Text2 = "5" Then
DoCmd.OpenReport precancelled_mail_permit_report, acViewPreview, , , acWindowNormal
Else
If Text2 = "6" Then
DoCmd.OpenReport pub_only_707 - 6 - 2, acViewPreview, , , acWindowNormal
Else
If Text2 = "7" Then
DoCmd.OpenReport Standard_mail_report, acViewPreview, , , acWindowNormal
Err_Command5_Click:
MsgBox Err.Description
Resume Exit_Command5_Click
End If
End Sub
When I click the button I get an error of "Block If without End If"
What is the right command to end this??