Link to home
Start Free TrialLog in
Avatar of TIgerV
TIgerVFlag for United States of America

asked on

Avoid negative quantity

I'm storing a quantity of current items in [tbl_quantity].[quantity].  (key field [ID], related to [tbl_items].[id] via one-to-one with referential integrity)

When using Form FRM_ORDER, I don't want to allow the order to exceed the quantity.  (Maybe a message "There are only x quantity on hand, adjust your order now."

What's the easiest way to do this, or does someone have a very simple inventory system (office supplies, not sales) they would like to share?
Avatar of Hamed Nasr
Hamed Nasr
Flag of Oman image

Try this in Validation Rule for the required field in the form:

Example to check if value entered in f2 is not more than f1:

Validation Rule: <=[f1]
Avatar of TIgerV

ASKER

No, that returns a very unintelligible error.
Can you reproduce the issue with a sample database?
ASKER CERTIFIED SOLUTION
Avatar of PatHartman
PatHartman
Flag of United States of America image

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 TIgerV

ASKER

Thank you!