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

sum control 1

Status
Not open for further replies.

asinarrgh

Programmer
Apr 2, 2003
9
SK
I have an parts inventory form that displays one part at a time.
On that form are two subforms: one that displays all the withdrawals on that part
and
one that displays all the orders for that part (whether still on order or received).
If the order has been received, it has a field that is filled in with "REC".
I would like to have a control on the main form that displays the total number of that part on hand.
How do I express the sum of JUST the orders received (even though the criteria for the Orders subform is ALL orders)?

Thank you.
 

Create an unbound field and place it on your main form. Set its Control Source to
DSum(fldName, qryName,"fldReceived='REC'")

fldName is the name of the field in qryName which contains the quantity of parts;

qryName is the query you use to build your subform showing all orders per part;

fldReceived is the name of the field in qryName in which you type 'REC'.

If you're changing the information on the subform, i.e. marking more orders as received, you'll need an event somewhere which updates the unbound field on your main form to keep it showing the current situation, else you'll have to keep reloading your main form.

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top