T
Tony
I have a line that in my code that I need to have broken up depending on the
info selected. On the form there are three drop down menus that allow the
user to select info. Depending if the user selects all 3 or 2 or 1 I would
the code to be able to handle this. Here is the current code:
Private Sub DoPrintOut(nMethod As Integer)
On Error GoTo Err_DoPrintOut
If IsNull(Me.Admin_Name) Then
MsgBox "Please select a Admin Name before trying to print."
Else
If IsNull(Me.Prof_Name) Then
MsgBox "Please select a Professor Name before trying to print."
Else
If IsNull(Me.Doc_Type) Then
MsgBox "Please select a Document type before trying to print."
Else
****DoCmd.OpenForm strReport, nMethod, , "( AdminID = " &
Me.Admin_Name & " and Professor = " & Me.Prof_Name & " and DocTypeID = " &
Me.Doc_Type & ") "****
Me.SetFocus
DoCmd.Close
End If
End If
End If
Exit_DoPrintOut:
Exit Sub
Err_DoPrintOut:
MsgBox Err.Description
Resume Exit_DoPrintOut
End Sub
I have put *** where I think the altered code needs to be placed, i.e.
something like an If Then statement, however I can not figure out how to
place it into that line. If you can offer some help that would be greatly
appreciated.
Thanks,
Tony
info selected. On the form there are three drop down menus that allow the
user to select info. Depending if the user selects all 3 or 2 or 1 I would
the code to be able to handle this. Here is the current code:
Private Sub DoPrintOut(nMethod As Integer)
On Error GoTo Err_DoPrintOut
If IsNull(Me.Admin_Name) Then
MsgBox "Please select a Admin Name before trying to print."
Else
If IsNull(Me.Prof_Name) Then
MsgBox "Please select a Professor Name before trying to print."
Else
If IsNull(Me.Doc_Type) Then
MsgBox "Please select a Document type before trying to print."
Else
****DoCmd.OpenForm strReport, nMethod, , "( AdminID = " &
Me.Admin_Name & " and Professor = " & Me.Prof_Name & " and DocTypeID = " &
Me.Doc_Type & ") "****
Me.SetFocus
DoCmd.Close
End If
End If
End If
Exit_DoPrintOut:
Exit Sub
Err_DoPrintOut:
MsgBox Err.Description
Resume Exit_DoPrintOut
End Sub
I have put *** where I think the altered code needs to be placed, i.e.
something like an If Then statement, however I can not figure out how to
place it into that line. If you can offer some help that would be greatly
appreciated.
Thanks,
Tony