sum of subform control and mainform

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
 
J

JohnFol

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

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

Top