ms access form validation

  • Thread starter Thread starter rajsal
  • Start date Start date
R

rajsal

I am very young in ms access vba,

I am trying to create a simple inventory system. I have a problem in
validation especially in my issue form. I have a query which calculate
the balance of item in stock.

So what i want is when the user issue items, through the issue form
and he/she typet the quantity more the the balance available in the
query, the system tell her/him that he/she is issuing more than
available in stock.

Please help me to write a code;
Note that, the query's name is qry_issue and the field which calculate
the balance is called qtybalance.

The form used to isue iten is called frm_issue and the field used
write the quantity of itema issued is acalled qyt.

Please help me.
 
I would normally display the quantity available in a textbox right next to
the IssueQty control on your form. Then, in the BeforeUpdate event of the
IssueQty control, I would check to see whether the value in that control is
greater than the AvailQty control and if it is, display an error message. At
the same time, in the BeforeUpdate event, you can set Cancel = True to
prevent Access from updating that field.

HTH
Dale
 
Back
Top