473,387 Members | 1,890 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,387 software developers and data experts.

Running Sum In Continuous Form In Ms Access 2003

Creating a running sum in continuous form in Access 2003
--------------------------------------------------------------------------------

Hello:

I have three forms on my user-interface.

Main form is called frmPatients.
Within this main form is an embedded form called fromVisitDates.
Linked to this form is the form called fsubfrmServices.

The last form (fsubfrmServices) is of CONTINUOUS TYPE.

I know I can use DSUM to calculate a running sum on SINGLE FORM but this same function does not work in CONTINUOUS TYPE.

This is what I am trying to accomplish.

I have a textbox that is called curTotalBal.

I need to create a running sum of this value so that the balances show up in the footer of this form.

For instance, JON DOE pays a visit and he is given 3 services worth $15. He only paid $5. His balance for today is $10.

Same JON DOE pays a visit tomorrow and is given 2 more services and is charged $10. He only paid $5. His balance is $5 for today.

His overall balance is $15 ($5 from today and $10 from yesterday).

I need to add up all the balances from each visit so that the grandtotal of balances is easily visible on the footer of this form. This is for the convenience of the front desk clerk to inform JON DOE that he owes XYZ amount everytime he pays a visit.

This is what I have done so far.

I created an unbound textbox in the footer of fsubfrmServices and its control source is as follows:

=DSUM("[curTotalBal]", "tblServices", "[pKeyServicesID]<="&forms!frmPatients!frmVisitDates!form!fsubfrmSe rvic es!form!pkeyServicesID)

When I run my form, I get #NAME? error.

Can anyone dissect this and help me out here???

Thanks in advance
Mike
Mar 16 '07 #1
6 7844
MMcCarthy
14,534 Expert Mod 8TB
Hi Mike

Firstly there is a syntax error in your code. Change as follows and see if it solves your problem.

Expand|Select|Wrap|Line Numbers
  1.  
  2. =DSUM("[curTotalBal]", "tblServices", "[pKeyServicesID]<=" &
  3. Forms!frmPatients!frmVisitDates.form!fsubfrmServices.form!pkeyServicesID)
  4.  
This will refer to the pkeyServicesID which is a control on the subform "fsubfrmServices" which is a subform on the "frmVisitDates" subform which is on the "frmPatients" main form.

Mary
Mar 16 '07 #2
Hi Mike

Firstly there is a syntax error in your code. Change as follows and see if it solves your problem.

Expand|Select|Wrap|Line Numbers
  1.  
  2. =DSUM("[curTotalBal]", "tblServices", "[pKeyServicesID]<=" &
  3. Forms!frmPatients!frmVisitDates.form!fsubfrmServices.form!pkeyServicesID)
  4.  
This will refer to the pkeyServicesID which is a control on the subform "fsubfrmServices" which is a subform on the "frmVisitDates" subform which is on the "frmPatients" main form.

Mary
Thank you Mary for your suggestion. I am sorry to inform you that it did not work. Do you have any other ideas?

Mike
Mar 19 '07 #3
MMcCarthy
14,534 Expert Mod 8TB
This will refer to the pkeyServicesID which is a control on the subform "fsubfrmServices" which is a subform on the "frmVisitDates" subform which is on the "frmPatients" main form.
Is this structure correct?

What error are you getting or incorrect result?
Mar 20 '07 #4
Is this structure correct?

What error are you getting or incorrect result?
Yes the structure is correct. The error I am getting is #Name?

Will it help if I were to zip a copy of my db and attach it here???

Let me know.

Mike
Mar 20 '07 #5
MMcCarthy
14,534 Expert Mod 8TB
Yes the structure is correct. The error I am getting is #Name?

Will it help if I were to zip a copy of my db and attach it here???

Let me know.

Mike
Hi Mike

It will only work if the zipped file is under 40 kb.

Mary
Mar 20 '07 #6
Hi Mike

It will only work if the zipped file is under 40 kb.

Mary
Let me cut it down and then I will COMPACT&REPAIR the db before I zip it.
If it is less than 40Kb then only I will post it.

thanks for your patience.
Mike
Mar 21 '07 #7

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Randy Harris | last post by:
In a continuous form I would like to force a specific record to the top of the screen. I can use DoCmd.GotoRecord to go to the record that I want, but how can I adjust the display so that record...
0
by: peterleeds | last post by:
Could anyone explain why Access 2003 is continuously calculating a continuous form, when it works perfectly in previous versions? On reading previous messages I gather that overlapping controls...
4
by: Kathy | last post by:
What is the standard technique for handling the fields in the following scenario on a continuous form? Multiple Divisions. Each Division has multiple Buildings. Each Building has a Supervisor. ...
11
by: Doug Bell | last post by:
Hi, I am trying to create form that displays data like an Access continuous dataform rather than using a data grid. I am thinking that I can achieve this by creating a row of text boxes, one...
1
by: blueheelers | last post by:
I have been researching for several hours on the best way to display images in continous forms in Access 2003. For example, I want to display employee name, email, phone, and picture for each...
5
by: kenethlevine | last post by:
Hello I am fairly new to Access and am having a problem for which I am trying everything without success. It is access 2003. I have a main form. When the user presses a button a modal popup...
13
by: eighthman11 | last post by:
using Access 2003 and sql server version 8.0 Hey everyone. Created a text box where the user types in an Inventory number and it takes them to that inventory number on the contimuous form. The...
1
by: MikiEns | last post by:
Hi all, Please excuse me if this is incorrect I am new to MS access and this Forum and appreciate any advice on posting. I would Like the Tab key on the key board to take the cursor down...
1
realayumi
by: realayumi | last post by:
ACCESS 2003 WIN XP Hi, i'm new in access, just a view days, this is my first post. Sorry for my bad English. I have 3 tables. tbl_product
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: 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: 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?
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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...

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.