[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 274
  • Last Modified:

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.
   
0
Mach1pro
Asked:
Mach1pro
1 Solution
 
DangerM0useCommented:
Put this in the forms module:

Private Sub Form_Error(DataErr As Integer, Response As Integer)

    Response = 0
   
End Sub

...Good Luck
0
 
NestorioCommented:
In the BeforeUpdate event enter:

Me.Undo

0
 
squirrlCommented:
DoCmd.SetWarnings False  'turn off messages

....Your code here

DoCmd.SetWarnings True  'turn on messages
0
 
Mach1proAuthor Commented:
Please see  Q_21404242.html
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now