473,396 Members | 2,092 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,396 software developers and data experts.

DSum, Function Methods - Need Assistance

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 some
guidance. This is related to Access 97 and involves my redoing a
miscellaneous purchase and sales form.

A main form (frmMain) is used that contains summary information of the
item. I incorporated two continuous subforms (sfrmPurchases) and
(sfrmSales). Of course, I also created two new tables for the subforms
(tblPurchases) and (tblSales). And also created three queries
(qryPurSales) and (qryPurchases), (qrySales) - the latter two use the
Sum function to group by ID and sum by the columns. The relationships
are the main form table as one to the two subform tables as many.

Everything seems to work okay, except that I'm having difficulty
sorting out the DSum expressions to use to provide some of the column
totals. Additionally, I have summary section at the top on the main
form showing the grand total results of the subforms along with more
calculations.

The three column totals that I having difficulty with all probably
require a similar expression. It is the sfrmSales TotalSales, Discount
and NetSales columns that do not total. The totals across are okay,
but the grand total at the bottom of each is not. As a side note, one
of the expressions I have used for the Purchases to be summarized in
the main form section which works is:
=DSum("[Purchases]","tblPurchases", "[IDPur] = " & [IDMain])

I also tried using a Function module to open a SQL recordset, but
could not get it to work either. I have substituted many variations of
(IDSales), (tblSales), (qryPurSales) and (qrySales) in my expressions.

Any assistance will be greatly appreciated. Thanks.
Nov 12 '05 #1
1 4777
Say you have a subform named sfm1; its recordset includes a field named ABC
which you want to total and show on the main form.
Put a textbox on the footer of the subform (the textbox, or even the entire
footer can be set to visible=false).
Let's call it TotalABC; set its ControlSource like this:
=Sum(ABC)
Now put a textbox named MainABC on your main form; set its ControlSource
like this:
=sfm1.Form.TotalABC

HTH
- Turtle

"Dalan" <ot***@safe-mail.net> wrote in message
news:50**************************@posting.google.c om...
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 some
guidance. This is related to Access 97 and involves my redoing a
miscellaneous purchase and sales form.

A main form (frmMain) is used that contains summary information of the
item. I incorporated two continuous subforms (sfrmPurchases) and
(sfrmSales). Of course, I also created two new tables for the subforms
(tblPurchases) and (tblSales). And also created three queries
(qryPurSales) and (qryPurchases), (qrySales) - the latter two use the
Sum function to group by ID and sum by the columns. The relationships
are the main form table as one to the two subform tables as many.

Everything seems to work okay, except that I'm having difficulty
sorting out the DSum expressions to use to provide some of the column
totals. Additionally, I have summary section at the top on the main
form showing the grand total results of the subforms along with more
calculations.

The three column totals that I having difficulty with all probably
require a similar expression. It is the sfrmSales TotalSales, Discount
and NetSales columns that do not total. The totals across are okay,
but the grand total at the bottom of each is not. As a side note, one
of the expressions I have used for the Purchases to be summarized in
the main form section which works is:
=DSum("[Purchases]","tblPurchases", "[IDPur] = " & [IDMain])

I also tried using a Function module to open a SQL recordset, but
could not get it to work either. I have substituted many variations of
(IDSales), (tblSales), (qryPurSales) and (qrySales) in my expressions.

Any assistance will be greatly appreciated. Thanks.

Nov 12 '05 #2

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

Similar topics

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...
0
by: Rolan | last post by:
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....
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...
4
by: Dalan | last post by:
Perhaps someone can share information on the methods to use to effect the automation process of creating the property to set the AllowBypassKey function. I was directed to:...
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: Marc Aube | last post by:
Is there a web site that can ofer some help. The quotation marks are posing an issue as well as other items for this function. I have some books but they are not consistent in their use of the code...
1
by: phaddock4 | last post by:
Being fairly inexperienced at Access 2000, i've been reading many posts here for the last several days, and testing myself to find the best approach to do the following in A2K: SET UP: I have...
3
patjones
by: patjones | last post by:
Good morning all: In what seems like an ongoing saga to make the DSum function do what I need it to, I am now having trouble with a user-defined function in my VBA module. Here's the offending...
2
jmoudy77
by: jmoudy77 | last post by:
Hi, I'm trying to use a variable "FirstSemi" as the second criteria in a DSum function. The DSum function is used in the same Form_Load function that the variable was declared. I keep getting an...
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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.