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

Show the total value of records being entered on a fform.

Status
Not open for further replies.

luccas

Technical User
Dec 21, 2000
30
US
I am entering daily sales into a table named tblSales with fields SalesCounter, Date, Shift, FoodSales, Tax and PayType.
I am loading this table from a form, frmDailySales, with two sub forms, frmDailySalesLunch and frmDailySalesDinner.
Forms frmDailySalesLunch and frmDailySalesDinner - both have tblDailySales as their data source , one with lunch as a default and one with dinner as a default. The sales are entered separately one tag per record,

I want to be able to see what the total daily sales are and the combined tag lunch totals and combined tag dinner totals for each day I have entered tags for, on frmDailySales.
How can this bs done?
 
Take a look at the DSum function

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
I,ve tried the DSum function in the contyol properties - data control source, =DSum([FoodTotal]).I can,t enter it I get the message "The expression you entered has a function containing the wrong number of arguments".
 
Why not using the expression generator or the help system ?

Hope This Help, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884
 
DSum function requires three arguments:-
=DSum('[The field you want to count]','[the table or query which holds the field]','[extra criteria]')

[extra criteria] is where you can manipulate the result i.e. = 2 or is like "a" or is null etc.

Be ALERT - Your country needs Lerts
 
Hi

On each of the sub forms make a hidden control for the total, set its source to =Sum(FoodSales), ane these controls TotalLunch, TotalDinner as appropriate

in you main form make two text box controls, with visible true, set their source to = Lunchsubformcontrolname.FORM.TotalLunch and Dinnersubformcontrolname.FORM.TotalLunch

where Lunchsubformcontrolname and innersubformcontrolname and the names of your sub form controls

Regards

Ken Reay
Freelance Solutions Developer
Boldon Information Systems Ltd
Website needs upgrading, but for now - UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top