Validation in Table, can't fall below zero.

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

Guest

I have an update query that is linked to a table that contains vouchers. I
can set up a validation rule in the table so it can't fall below zero, but I
would like the query to be able to look at the table first and decide if the
number being entered would cause the field in the table to fall below zero.
If it does fall below zero, I would like it to cancel the event and display a
generic error message.

Any ideas? They are all greatly appreciated.
 
UPDATE MyTable SET MyField = iif (BLAH<0, MyField, BLAH)

"Set MyField to BLAH, unless BLAH<0, in which case, leave the value of
MyField unchanged."

HTH,
TC (MVP Access)
http://tc2.atspace.com
 

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

Back
Top