473,703 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DSum([Field) in Subform where its current-records are stored with all subform records

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 created a MainTable (and related form), which has an associated
SubForm (popup) along with its underlying, separate Table.

The tables' relationship is one to many respectively. The primary key
for the MainTable is the ClientId, and the foreign key in the SubForm's
Table.

The MainForm shows a beginning balance, and allows users to select an
add-transaction button. If they do, then a data-entry-only version of
the SubForm appears, this works well. If prior transactions have been
entered since the original beginning balance, each of the preceding
transaction is posted and displays as a sequential record in the
continuous version of the SubForm. All Forms display by a single common
ClientId.

All new transactions for every account are stored in the SubForm's
many-Table (the beginning balance in the SubForm's footer).

GOAL:

My goal is to dispaly a current total in the footer of the SubForm
after every new transaction is entered, which includes the beginning
balance from the MainForm/Table.

ATTEMPTS:

I have tried DSum() but it totals the [Amount] of each record in the
entire domain. The records displayed in the continuous SubForm are a
subset, and this is the total I need. In other words, all transactions
are stored in the SubForm Table, but just the current record/ClientId
transactions are displayed and need totaled.

Also, iterating through the table, e.g., MoveNext, etc. is expensive in
time and overhead. But, I've tried this too with limited success.

POSSIBILITIES:

Is there a way to select only part of the entire SubForm Table by
ClientId, so that the DSum() function just returns the sum for the
current Client displayed on the MainForm and its SubForm?

I did read where someone created a SnapShot Query on the continous
form's OpenForm event, and posted the total at that time. Then if
records in the continuous form were changed new calculations were
executed to adjust the total. Alas, no example, just verbage. Would
you use the RecordsetClone. args for this?

I've tried creating SQL statements in the design view and then placing
them in the VBA code, but if my statements are very long, and they are,
then Access belches at my crude implementations .

REQUEST:

If anyone has been down this road before and garnered a successful
solution, I really do appreciate you sage advise or wisdom on this
issue.

Nov 13 '05 #1
1 4439
One the better stated questions! Not exactly what you requested, but one of
the common solutions is to have an unbound control on the Main form that
uses DSum() to get the value from related records. If this appears just
below the amount control in your subform, users will understand.

You'd need to requery that control after editing/adding any record in the
subform. Use the AfterUpdate event of the subform to requery the unbound
"total amount" control.
-Ed

<ph*******@sbcg lobal.net> wrote in message
news:11******** **************@ f14g2000cwb.goo glegroups.com.. .
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 created a MainTable (and related form), which has an associated
SubForm (popup) along with its underlying, separate Table.

The tables' relationship is one to many respectively. The primary key
for the MainTable is the ClientId, and the foreign key in the SubForm's
Table.

The MainForm shows a beginning balance, and allows users to select an
add-transaction button. If they do, then a data-entry-only version of
the SubForm appears, this works well. If prior transactions have been
entered since the original beginning balance, each of the preceding
transaction is posted and displays as a sequential record in the
continuous version of the SubForm. All Forms display by a single common
ClientId.

All new transactions for every account are stored in the SubForm's
many-Table (the beginning balance in the SubForm's footer).

GOAL:

My goal is to dispaly a current total in the footer of the SubForm
after every new transaction is entered, which includes the beginning
balance from the MainForm/Table.

ATTEMPTS:

I have tried DSum() but it totals the [Amount] of each record in the
entire domain. The records displayed in the continuous SubForm are a
subset, and this is the total I need. In other words, all transactions
are stored in the SubForm Table, but just the current record/ClientId
transactions are displayed and need totaled.

Also, iterating through the table, e.g., MoveNext, etc. is expensive in
time and overhead. But, I've tried this too with limited success.

POSSIBILITIES:

Is there a way to select only part of the entire SubForm Table by
ClientId, so that the DSum() function just returns the sum for the
current Client displayed on the MainForm and its SubForm?

I did read where someone created a SnapShot Query on the continous
form's OpenForm event, and posted the total at that time. Then if
records in the continuous form were changed new calculations were
executed to adjust the total. Alas, no example, just verbage. Would
you use the RecordsetClone. args for this?

I've tried creating SQL statements in the design view and then placing
them in the VBA code, but if my statements are very long, and they are,
then Access belches at my crude implementations .

REQUEST:

If anyone has been down this road before and garnered a successful
solution, I really do appreciate you sage advise or wisdom on this
issue.

Nov 13 '05 #2

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

Similar topics

3
29019
by: MX1 | last post by:
I have a query written in MS Access that has a few calculated fields. Is it possible to refer to that query in a form field. I'd like the form field to show the sum of one of the columns from the query I've written. I've tried to put the following in the form field's control source property but I'm getting an error. Query1 is the name of the query and CalculatedTotal is the calc'd field column I'm trying to get a total for in the form...
1
4154
by: Alex | last post by:
Acc 97 Hi, I have the following in my query which works well if it is all set to numbers on table design. But what I want to do is where it states MC (short for machine name) use the actual machine name of which there are 5 off. therefore, on the table design I flick it over to text mode.
4
3009
by: John Baker | last post by:
Hi: I have a form, and wish to show on the form the current total for a single field on a table. I have set this up thus: =DSum(,!) in an unbound text field. These are correct field and table names. While the formulation is accepted by the system, nothing appears in the field and no results show up at all. I tried a number of combinations with no success. Can someone tell me what I am doing wrong? Thanks
3
3763
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 trying to do is create a subreport for the main report which gives a generalised breakdown of the main report. For the gender of 'Ladies', there may be several parea's so I want to sum the packs_req for ladies only. (Gender is not a field I can use,...
4
2651
by: John Baker | last post by:
Hi: At the bottom of a report, I wish to sum all the amounts that appear in a field called Discount$ that appears on the report. I am not doing this summing in the query that supports the report because I have sprinkled the discounts amount into every record, and it only applies in the totals summary for each invoice. In any case, the Field is called Discount$ and the report is called RINV1Q1. How do I reference the field in the report...
2
1927
by: GD | last post by:
tblFoo FooId Name Number 1 One 1 2 Two 2 3 Three 3 The Following query produces the results I want, but it is not updatable. I need at least the "Number" field to be updatable.
3
2955
by: beppe005 | last post by:
I would like to calculate a total for all the field with the same in a query. I don't know how to set the "criteria" for this dsum function, it should be something like = but it doesn't make sense. The query is something like: +-- --- ---- ---- --- ---+ +--1-----Alpha-------a1----------------1------------4------------------+ +--1-----Alpha-------a2----------------3------------4------------------+
4
5208
by: john | last post by:
I have an unbound field in which I would like to show january 1 of the current year like this 01-01-2007. I tried this code but it doesn't work: =dateserial(Year(date()),1,1) Can someone help me out? Thanks in advance, john
4
2036
by: Adam1331 | last post by:
I've been trying to get the DSum function to work but I've been running into some roadblocks. What I'm trying to do is to total up times in a timesheet report into different departments. The report is based on a query that gathers all an employee's info. In that query, I have a calculated field which gives an employee's total time on a process. (DateDiff("n",,))/60 This gives the total time in hourly fractions. Now what I'm trying to do...
3
2074
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, the . part is drawing from a separate reference table which cycles through plugging in the name for each DB_ and Ben_ field in the CSO table. What I want to do is add another layer of criteria, the field which exists in the same CSO table. I'd...
0
8758
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8669
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9121
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7867
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4432
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4687
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3123
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2069
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.