473,288 Members | 1,750 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,288 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 3322

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,...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

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.