A
Alex Martinez
Hi,
I need some help here. I have the following field:
MD - combobox
FE - Yes/No field
FV - Yes/No Field
FP - combobox
CO - combobox
Rev - combobox
Ck - combobox
Dis - combobox
If the user populates MD or FE or FV field and also populates the FP or CO
or CK or Rev, or Dis field I want an error message to appear (see below),
but it seems that I am not 100% sucessful. For example the user can
populate the cboFP field and populate the cboMD field selecting whats in
the combobox for example "A1" then the dialog box appear, but if the use
select "A2" in the cboMD and the cboFP or any other field (CO, CK, Rev, or
Dis) I don't get the dialog box. What am I doing wront. Thank you in
advance.
Private Sub Form_BeforeUpdate(Cancel As Integer)
ElseIf Me.[cboMD]) = "A1" or Me.[cboMD]) = "A2" Or Me.[FV] = -1 Or Me.[FE]
= -1 And Not IsNull(Me.[cboFP]) Or Not IsNull(Me.[cboCO]) Or Not
IsNull(Me.[cboRev]) Or Not IsNull(Me.[cboCk]) Or Not IsNull(Me.[cboDis])
Then
Cancel = True
MsgBox "Is this a PA or MA?. Try Again."
End If
End Sub
I need some help here. I have the following field:
MD - combobox
FE - Yes/No field
FV - Yes/No Field
FP - combobox
CO - combobox
Rev - combobox
Ck - combobox
Dis - combobox
If the user populates MD or FE or FV field and also populates the FP or CO
or CK or Rev, or Dis field I want an error message to appear (see below),
but it seems that I am not 100% sucessful. For example the user can
populate the cboFP field and populate the cboMD field selecting whats in
the combobox for example "A1" then the dialog box appear, but if the use
select "A2" in the cboMD and the cboFP or any other field (CO, CK, Rev, or
Dis) I don't get the dialog box. What am I doing wront. Thank you in
advance.
Private Sub Form_BeforeUpdate(Cancel As Integer)
ElseIf Me.[cboMD]) = "A1" or Me.[cboMD]) = "A2" Or Me.[FV] = -1 Or Me.[FE]
= -1 And Not IsNull(Me.[cboFP]) Or Not IsNull(Me.[cboCO]) Or Not
IsNull(Me.[cboRev]) Or Not IsNull(Me.[cboCk]) Or Not IsNull(Me.[cboDis])
Then
Cancel = True
MsgBox "Is this a PA or MA?. Try Again."
End If
End Sub