Error message

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
 
P

pietlinden

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...
 
P

pietlinden

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top