D
David
Hello group,
The purpose of this code is to check that these two fields
are NOT blank or NUll before I continue with the code. I
have a group of subfunctions that use If Then Else. I
would like to send all of the FALSE results to a specific
subfuction titled SPECIAL below. The glitch is I only
want this subfunction to FIRE if one of my subroutine
FIREs it as a result of FALSE. The subfunction titled
SPECIAL fires everytime the routine is executed. If the
result is TRUE, the system displays the msgbox in the
subroutine and then displays a second msg box in the
SPECIAL subroutine. How can I work it so that the SPECIAL
subroutine only fires if one of the subfunctions results
are FALSE?
Private Sub Submit_Click()
GoTo My_Date_of_Request
My_Date_of_Request:
If [Date of Request] <> "" Then
GoTo My_Date_of_Delivery
Else
GoTo My_SPECIAL
Exit Sub
End If
My_Date_of_Delivery:
If [Date of Delivery] <> "" Then
MsgBox "Request Number DR04-" & [Data Request Number]
& "."
Else
GoTo My_SPECIAL
Exit Sub
End If
My_SPECIAL:
MsgBox "Enter Required Fields in RED. "
'I can place the above line of code after
'the ELSE for each subroutine above, but I want to
'add multiple commands and functions in
'this routine.
On Error GoTo Err_Submit
Exit_Submit:
Exit Sub
Err_Submit:
MsgBox "Enter Required Fields. "
Exit Sub
End Sub
The purpose of this code is to check that these two fields
are NOT blank or NUll before I continue with the code. I
have a group of subfunctions that use If Then Else. I
would like to send all of the FALSE results to a specific
subfuction titled SPECIAL below. The glitch is I only
want this subfunction to FIRE if one of my subroutine
FIREs it as a result of FALSE. The subfunction titled
SPECIAL fires everytime the routine is executed. If the
result is TRUE, the system displays the msgbox in the
subroutine and then displays a second msg box in the
SPECIAL subroutine. How can I work it so that the SPECIAL
subroutine only fires if one of the subfunctions results
are FALSE?
Private Sub Submit_Click()
GoTo My_Date_of_Request
My_Date_of_Request:
If [Date of Request] <> "" Then
GoTo My_Date_of_Delivery
Else
GoTo My_SPECIAL
Exit Sub
End If
My_Date_of_Delivery:
If [Date of Delivery] <> "" Then
MsgBox "Request Number DR04-" & [Data Request Number]
& "."
Else
GoTo My_SPECIAL
Exit Sub
End If
My_SPECIAL:
MsgBox "Enter Required Fields in RED. "
'I can place the above line of code after
'the ELSE for each subroutine above, but I want to
'add multiple commands and functions in
'this routine.
On Error GoTo Err_Submit
Exit_Submit:
Exit Sub
Err_Submit:
MsgBox "Enter Required Fields. "
Exit Sub
End Sub