AfterUdate

K

Kasey

I have a form where I have "QtyOnHand" and
Unbound "QtyUsed" I can't get the QtyOnHand to change when
I leave the QtyUed field--it changes when I move to the
next record. How can I get it to change when I leave the
QtyUsed field. My code Is:
Private Sub QtyUed_AfterUpdate()

'Clear FIND Qty Used box
Me!QtyUsed.Value = " "

End Sub

Thanks in advance for any help.
 
A

Allen Browne

Kasey, if you succeed in this, you will have created a disaster.

What happens if I type in 100, tab to the next field, and then press Esc to
undo the change. You have already subtracted 100?

What happens if I type in 100 (and you subtract 100), and then realise it
should have been 10, so I go back to the control and type 10? Have you then
subtracted 110 (100, and then 10), instead of 10?

What happens if the user deletes the row where 10 were "used"? Do you have a
way to add them back on again?

There is no way to create a reliable piece of software by using the
AfterUpdate event of the control to manage the quantity on hand. For a
general discussion of the topic and the issues involved, see:
Inventory Control - Quantity On Hand
at:
http://allenbrowne.com/AppInventory.html
 
K

Kasey

This Db will be used by only 4 people so am trying to keep
it simple. Also I am a Newbie at access and don't
understand anything about what you are talking about on
your help page....got any simple fix for a simple person?
Kasey
 
A

Allen Browne

The simplest thing I can suggest is:
Don't store the value. See help on DSum().
 

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