sum of subform control and mainform

  • Thread starter Thread starter Pradeep
  • Start date Start date
P

Pradeep

I have subform which tracks the incoming lot for the orders placed.

Lets say i have an order of 10 for an item. And i recieve three lots
of 2,3 and 4 nos. Thus you have three records in incoming lot
quantity.

Now what i want is, if the user tries to enter a new record and enter
quantity 2 then it should not be allowed ( since that will take the
count to 11). He should be allowed to enter only 1.

Also if he tries to update the value from 4 to 6 it shouldn't be
allowed ( since that will again take the count to 11).

What should be my approach.

Thanks
 
If you have the value 10 stored against a "CurrentStockLevel" field, I
presume you'l be decrementing it on each of the first 3 records as well as
the 4th. . .

On the BeforeUpdate you could do

If DLookup("CurrentStockLevel", "StockLevelTable", "StockItemID=" &
me!ItemOrdered) < me!qtyItemsOrdered then
.....
...
..
 
Back
Top