Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Undo a subForm action from a main Form undo action?

Status
Not open for further replies.

ChrisTheAncient

Technical User
Dec 22, 2002
169
GB

Progressing along quite nicely with a little database for things I'm hoping to sell. My database is based on the classic NWinds one from MS.

I have a 'main' order Form with an embedded subForm to itemise goodies sold to an individual customer

To help me along, I'm trying to embed a sort of stock control so I know what is in stock at the end of each transaction.

So far, I've successfully made the subform decrement the stock as each item is added to an order by using

Me!UnitsInStock = Me!UnitsInStock - 1

in the ProductID_AfterUpdate() property.

Up to this point, I'm quite pleased with how I've done!

Then, I thought, suppose part way through filling in the order, I want to cancel it! No hassle, just use the command button wizard to create an 'Undo' button (which works just fine) and I've got a neat sorting out of that record.

But... (That dreaded word)...
The decremented stock level stays decremented and my inventory won't balance.

So, is there a way that when I click the main Form 'Undo' that I can 'Undo' the things that were done in the subForm? Is there a simple (and I mean simple) way to put back those stock items?

My vb and coding skills are limited; but I'll try!

TIA

Chris


*************************************
OK, I'm stoopid. But I'm good at it!
*************************************
 
Refresh


*************************************
OK, I'm stoopid. But I'm good at it!
*************************************
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top