Link to home
Start Free TrialLog in
Avatar of Mach1pro
Mach1pro

asked on

Suppress record update error message

I have a very simple table of usernames, passwords, and a few other fields.
I have a continuous form based on this table.
In the Before update event of the password field, I check for minimum length, maximum length, and non alphanumeric characters. If the password doesn't meet the criteria then I let the user know and then cancel the event.
    Msgbox "Invalid Password...etc."
    Cancel = True

Unfortuanately, after my message box is closed, Access pops up its own message box about "The value in the field or record violates the validation rule for the record or field"

How can I suppress this message so that the user can just correct the password field and continue on. It seems like it should be simple, but its driving me nuts.
   
ASKER CERTIFIED SOLUTION
Avatar of DangerM0use
DangerM0use

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Nestorio
Nestorio

In the BeforeUpdate event enter:

Me.Undo

DoCmd.SetWarnings False  'turn off messages

....Your code here

DoCmd.SetWarnings True  'turn on messages
Avatar of Mach1pro

ASKER

Please see  Q_21404242.html