473,386 Members | 1,606 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

DSum Assistance for Building Expression

I'm using Access 97 and need some assistance in sorting out a proper
DSum expression, or maybe even DCount might be an alternative. I have
tried numerous combinations, but with no apparent success.

The DSum function relates to a subform (sfrmCost) with a text box
(RefCost) which is intended to be the container for a total from a
query (qryItems). The query has three number columns from the table
(tblItems) of which I have an expression with NZ to provide the
subtotals (QSub) for the individual rows.

What I'm trying to accomplish is to use a DSum expression to tally the
(QSub)'s by like (IDRef) numbers. Currently, if there is only one row
with the same IDRef then the (QSub) represents all cost for it and
does post correctly to (sfrmCost) which in turn is posted to the
(TotalItemCost) text box on the main form (frmMain). The
(TotalItemCost) box on (frmMain) uses
=[Forms]![frmMain]![sfrmCost]![RefCost] to obtain the total from
(sfrmCost).

I have also tried using DSum expressions in the control source of the
(RefCost) of (sfrmCost) and in the control source of the
(TotalItemCost) of (frmMain), but this hasn't work either.

Excuse me, but it seems that I have created a somewhat convoluted
tangent above, so allow me to recap:

Table: (tblItems)
(IDRef) - a manually keyed ID # referencing a record on the
main form

Query: (qryItems)
(QSub) - contains the subtotal of one calculated row of three
items - Dsum needed to calculate the QSub totals by the same (IDRef)
when there is more than one row of same.

SubForm: (sfrmCost) - shows all IDRef's and other columns from
tblItems -
(RefCost) - a text box that currently shows the total of
=[Col1]+[Col2]+[Col3] by individual row

Form: (frmMain) - to show the final result of the DSum total by ID
reference.
(TotalItemCost) - the text box to show the total cost for all,
but currently only a one row occurrence using:
=[Forms]![frmMain]![sfrmCost]![RefCost]

Perhaps I should ask which is better to use: an intermediate query or
a control source? Here are a couple of DSum expressions that I have
used:

' in Query =DSum("[QSub]","qryItems","[IDRef] = & Me![IDRef]")

' on Main Form TotalItemCost=DSum("[QSub]","qryItems","[IDRef]=
[Forms]![frmMain]![sfrmCost]![RefCost]")

Any assistance provided will be greatly appreciated. Thanks, Rolan
Nov 12 '05 #1
0 3326

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Bill | last post by:
Good Day; I would appreciate assistance developing a query that I haven't been able to develop without using a second table. I wish to count the number of records that are still open on the...
1
by: Rolan | last post by:
I'm using Access 97 and need some assistance in sorting out a proper DSum expression. It relates to a subform (sfrmCost) from which I'm wanting to extract the grand total of any and all data rows...
1
by: Dalan | last post by:
I have tried both methods of using DSum and creating a Function to address summing some number columns, but to no avail. Since this has been a popular topic over the years, I'm sure I'll receive...
2
by: Dalan | last post by:
I seemed to be having problems with structuring the use of NZ with a DSum expression. Having tried numerous variations of the expression without success, I'm asking for assistance. First some...
3
by: Mark Reed | last post by:
All, I have never used this function before and am not sure it what I need. Just to clarify, I have a report based on a query which has amoungst other field, wk, parea & packs_req. What I am...
1
by: gbb0330 | last post by:
Hi All i am trying to calculate Quantity on hand in a unbound textbox in a form with a subform QonHand=Qreceived - TotalQSold TotalQsold=QsoldOnEbay+QsoldThruOtherChannels here is my...
8
by: deercreek | last post by:
I have the following table test3. RESERVATIONID Site SitePrice 101 RV2 $25.00 101 RV3 $25.00 102 RV4 $25.00 102 RV5 $25.00 104 ...
33
by: potassium flower | last post by:
I am trying to create a food order system for a restaurant. I have tried using both the DSum and Sum functions to calculate the total cost of an order. The total cost is a textbox on the form...
3
by: majapa | last post by:
To start, here is my DSum expression: Develop: Nz(DSum(". & "] + . & "]","CSO","='Ability to Develop'")*-1,0) I actually have 4 of these, each one with a different option for . For more context,...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.