If Me.MEMBERNO = "H23917176" Or Me.MEMBERNO = "H39592261" Then
Cancel = True
Else
MsgBox "** Contact the fraud dept. ASAP **"
Exit Sub
End If
End Sub
:
What is the actual error?
post the entire sub or function.
Is MEMBERNO the name of a control on your form?
--
Dave Hargis, Microsoft Access MVP
:
13.2
The message box appears no matter what is entered??
:
Actually, this should only be 13.1
If Me.MEMBERNO = "H23917176" Or Me.MEMBERNO = "H39592261" Then
Oops, left out the =
--
Dave Hargis, Microsoft Access MVP
:
Compile error - Suggestions for #14??
If Me.MEMBERNO = "H23917176" Or Me.MEMBERNO "H39592261" Then
Cancel = True
Else
MsgBox "**.....
:
Here is number 13
If Me.MEMBERNO = "H23917176" Or Me.MEMBERNO "H39592261" Then
--
Dave Hargis, Microsoft Access MVP
:
That is perfect - Thanks
One last question - I'm trying to add an "OR" statement:
If Me.MEMBERNO = "H23917176" Or "H39592261" Then
I've tried about 12 other was and I'm getting no-where..
Suggestions??
:
That is not correct, Dennis. It is in the form control (box), but not yet
updated to the form's recordset. One thing that is missing is canceling the
event. I would put a line
Cancel = True
just before the Msgbox line.
Run the code in debug mode to determine why it is not showing the message box.
--
Dave Hargis, Microsoft Access MVP
:
You need to put it in the after update event instead because in the before
update, the value is not in the box yet.
:
I'm trying to add a pop-up comment when the user enters a certain number in
the text box.
The code below I added to the text box but it does nothing.
Any suggestions.
Private Sub MEMBERNO_BeforeUpdate(Cancel As Integer)
If Me.MEMBERNO = "H23917176" Then
MsgBox "** Please contact the fraud dept. **"
Exit Sub
End If
End Sub