Hi Folks,
I've created a basic error check for an button operation in a Power Point "form". This is being called by sub go_click (). I'd like to have the go_click() sub stop if any of the conditions are met for an error message to pop up. Is there a way to do this? I'm just a hack an slash beginner vba user.
Thanks,
Mike
I've created a basic error check for an button operation in a Power Point "form". This is being called by sub go_click (). I'd like to have the go_click() sub stop if any of the conditions are met for an error message to pop up. Is there a way to do this? I'm just a hack an slash beginner vba user.
Thanks,
Mike
Code:
Private Sub error_check()
' blank option
If Returnable = False And disposable = False Then
MsgBox "Please select a Packaging Type. It is currently blank."
End If
If dap = False And fca = False Then
MsgBox "Please select an Incoterm. It is currently blank."
End If
If warehouse = False And plant = False And tct = False And three_pl = False Then
MsgBox "Please select a Delivery Location. It is currently blank."
End If
If dap = False And fca = False Then
MsgBox "Please select an Incoterm. It is currently blank."
End If
If FL01 = False And FL02 = False And FL04 = False And FL05 = False Then
MsgBox "Please select a Flow Type. It is currently blank."
End If
If repack = False And norepack = False Then
MsgBox "Please select an Internal Repack Strategy. It is currently blank."
End If
'----------------------------
'Incorrect flow to delivery location
If FL01 = True And plant = False Then
MsgBox "Flow 1 material must be delivered directly to the Plant. Please select the Direct to Plant (FL01) Delivery Location."
End If
If FL01 = False And plant = True Then
MsgBox "Material delivered directly to the Plant must have a FL01 flow. Please select FL01 as the flow type."
End If
If FL04 = True And three_pl = True Then
MsgBox "Material delivered directly to the 3PL must have a FL02 flow. Please select FL02 as the flow type."
End If
'----------------------------
'Flow and Internal Repack
If repack = True And FL02 = True Then
MsgBox "FL02 material cannot be repacked. Please select either another flow type or a different Repack Strategy."
End If
If repack = True And FL01 = True Then
MsgBox "FL01 material cannot be repacked. Please select either another flow type or a different Repack Strategy."
End If
If three_pl = True And FL01 = True Then
MsgBox "3PL material cannot be FL01. Please select a different Flow."
End If
End Sub