Error message

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi!

To prevent duplicates records I have a personalized form with explanation
why not is possible.

But in this case, appear too a information notice:
"The value violates the validation rule for the field or record"

Is not possible with DoCmd.SetWarnings = False (or On Error Resume Next)
omit it?
If yes, where please?

Thanks in advance.
an
 
Hi!

To prevent duplicates records I have a personalized form with explanation
why not is possible.

But in this case, appear too a information notice:
"The value violates the validation rule for the field or record"

Is not possible with DoCmd.SetWarnings = False (or On Error Resume Next)
omit it?
If yes, where please?

Thanks in advance.
an

you'd be better off trapping for the specific error. (3022, I think?),
and then providing your own custom message, and then handling it in
the Error routine.

just my opinion... YMMV...
 
Boy I'm stupid sometimes. You cannot override *table*-level
validations. If you declare a unique index and then violate the the
validation rule, you cannot add the record. Period. You'd have to
use DCount() in your forms to see if you have duplicate records and
then display your own messages.

Serious hassle if you have people updating records, which can break
validation rules. You'd have to wrap that in some kind of function to
disable updates that would fail.
 
Back
Top