gmlwong
Registered User.
- Local time
- Today, 07:53
- Joined
- Feb 7, 2003
- Messages
- 48
I have the following on the "On Open" event of a form:
If [Check911] = True And [CustState] = "AZ" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "CA" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "CT" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "FL" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "HI" Then
MsgBox "File Pending... DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "IA" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "KS" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "MN" Then
MsgBox "NO TM ALLOWED. Motorcycle & Watercraft Only. DO NOT proceed with this contract unless it is an AMC or WAW. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "NH" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "NY" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "OK" Then
MsgBox "NOT AN APPROVED STATE. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "WI" Then
MsgBox "NOT AN APPROVED STATE. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "WY" Then
MsgBox "File Pending... DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
If [Check911] = False And [Text815] = "HI" Then
MsgBox "File Pending... DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = False And [Text815] = "OK" Then
MsgBox "NOT AN APPROVED STATE. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = False And [Text815] = "MN" Then
MsgBox "NO TM ALLOWED. Motorcycle & Watercraft Only. DO NOT proceed with this contract unless it is an AMC or WAW. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = False And [Text815] = "WI" Then
MsgBox "NOT AN APPROVED STATE. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = False And [Text815] = "WY" Then
MsgBox "File Pending... DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
End If
End If
End If
End If
End If
*** All I'm trying to accomplish with this is for the form, on it's "On Open" event, to recognize if [Check911] check box = True and the [CustState] field has any of these values, the respective message box should appear to alert the user of the issue described. And, if the [Check911] check box = False and the [Text815] field has any of the listed values, the respective message box should appear to alert the user of the issue described...
My refresh statement is placed correctly and does work but none of the above code is being recognized for this event; the [Check911] box does refresh and hits during the "On Open" event of the form as the form blinks to confirm the refresh command is being recognized.
I did try placing this code in the "On Current" event but nothing happens...
*** The [CustState] field is tied to a separate table called[tblStates] and appears as a combo box on this form...can it be that this code cannot be used because the field being called on is a combo box?
Mr. Hartman, Miles, Vass, AutoEng, Idjit...anyone else, if you can help, very appreciated.
If [Check911] = True And [CustState] = "AZ" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "CA" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "CT" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "FL" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "HI" Then
MsgBox "File Pending... DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "IA" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "KS" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "MN" Then
MsgBox "NO TM ALLOWED. Motorcycle & Watercraft Only. DO NOT proceed with this contract unless it is an AMC or WAW. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "NH" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "NY" Then
MsgBox "NO TM ALLOWED. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "OK" Then
MsgBox "NOT AN APPROVED STATE. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "WI" Then
MsgBox "NOT AN APPROVED STATE. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = True And [CustState] = "WY" Then
MsgBox "File Pending... DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
End If
If [Check911] = False And [Text815] = "HI" Then
MsgBox "File Pending... DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = False And [Text815] = "OK" Then
MsgBox "NOT AN APPROVED STATE. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = False And [Text815] = "MN" Then
MsgBox "NO TM ALLOWED. Motorcycle & Watercraft Only. DO NOT proceed with this contract unless it is an AMC or WAW. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = False And [Text815] = "WI" Then
MsgBox "NOT AN APPROVED STATE. DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
If [Check911] = False And [Text815] = "WY" Then
MsgBox "File Pending... DO NOT proceed with this contract. Contact TY ASAP to deactivate this record.", vbExclamation, "This is an UNAPPROVED STATE for this Direct Marketer Dealer."
Me.CustState.Enabled = False
End If
End If
End If
End If
End If
*** All I'm trying to accomplish with this is for the form, on it's "On Open" event, to recognize if [Check911] check box = True and the [CustState] field has any of these values, the respective message box should appear to alert the user of the issue described. And, if the [Check911] check box = False and the [Text815] field has any of the listed values, the respective message box should appear to alert the user of the issue described...
My refresh statement is placed correctly and does work but none of the above code is being recognized for this event; the [Check911] box does refresh and hits during the "On Open" event of the form as the form blinks to confirm the refresh command is being recognized.
I did try placing this code in the "On Current" event but nothing happens...
*** The [CustState] field is tied to a separate table called[tblStates] and appears as a combo box on this form...can it be that this code cannot be used because the field being called on is a combo box?
Mr. Hartman, Miles, Vass, AutoEng, Idjit...anyone else, if you can help, very appreciated.