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 TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA code to DSUM

Status
Not open for further replies.

databasesrus

Technical User
May 29, 2003
35
US
I am trying desperately to total inventory levels. I have tried update queries and DSum's in my form. Something is definately not right.

I have a table which lists starting quanitities. I have another table in which via form users are entering inventory changes.

How can I just have the current total after changes?

I need the starting quanting + quantity received - quantity processed - quantity rejected - quantitity shipped


This is the final piece of my entire database so it is critical...

Any suggestions, comments, etc. would be greatly appreciated! Thank you!
 
You seem to have designed the tables correctly. I am referring to the one-to-many relationship without having a field for the current balance. This is a value that should be calculated and not a hard value in a inventory record.

If the transaction records are stored as minus values then for a form control you could use this as the Control Source:
=DLookUp("[Starting_Balance]", "tblInvStart", "[Product_ID] = '" & Me.[Product_ID] & "'") - DSum("[Trans_Amt]", "tblInvTrans", "[Product_ID] = '" & Me.[Product_ID] & "'")

Bob Scriver

Nobody believes the official spokesman... but everybody trusts an unidentified source.
Author, Bagdad Bob???

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top