473,473 Members | 1,844 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Calculating Total for Subform dispalyed on Form

4 New Member
Hi,

Not really a programmer here, but have been forced into the role. I was asked to develop a basic time sheet for employees to enter time. I developed the Table without a problem. I then developed a query to limit the records displayed based upon an employee last name and a month. Once again no problem. I then stareted developing the form based on the query. The form has a subform using data sheet display. Form prompts user for month an last name (based on query mention above) and displays the selected records on the screen. Users then wanted a total so they could see how many hours they input. First attempt yielded a total for the enitre database not just the records displayed. I used this in the control source:

=Sum([hours spent])




The second attempt got an #error message using the following in the control source for the field:

=Sum([Test ime allocation Query].Form![hours spent])

Using Access 2003 on Windows XP. So, anyone have suggestions. I just need the total to display for the selected records. Would be nice if the total recalculated as people updated their time entries. Thanks in advance.

Dave
Oct 16 '06 #1
2 16977
MMcCarthy
14,534 Recognized Expert Moderator MVP
Try this:

In the datasheet subform go to design view and in the form footer put a control named totalTime set to the following:

=Sum([hours spent])

Then on the main form put a control set to the following

=[Test ime allocation Query].Form![totalTime]

Hi,

Not really a programmer here, but have been forced into the role. I was asked to develop a basic time sheet for employees to enter time. I developed the Table without a problem. I then developed a query to limit the records displayed based upon an employee last name and a month. Once again no problem. I then stareted developing the form based on the query. The form has a subform using data sheet display. Form prompts user for month an last name (based on query mention above) and displays the selected records on the screen. Users then wanted a total so they could see how many hours they input. First attempt yielded a total for the enitre database not just the records displayed. I used this in the control source:

=Sum([hours spent])




The second attempt got an #error message using the following in the control source for the field:

=Sum([Test ime allocation Query].Form![hours spent])

Using Access 2003 on Windows XP. So, anyone have suggestions. I just need the total to display for the selected records. Would be nice if the total recalculated as people updated their time entries. Thanks in advance.

Dave
Oct 16 '06 #2
dath
4 New Member
Thanks so much. It worked.

Dave
Oct 16 '06 #3

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

Similar topics

4
by: James Greig | last post by:
hello people, i'm just learning javascript, could someone point me in the direction of an example of the following, or give me some clues as to how it might be done: what i would like to do...
9
by: chris vettese | last post by:
On my subform I have a field in the footer that totals the value of a field. On the main form I have referenced this field. I'm using this field in a calculation on my main form. The problem...
3
by: jburris | last post by:
I have been through enough of these threads to think that this should be an easy fix... but, are there circumstances in which the following code syntax does not work? =!!.Form! (this is out of...
3
by: JDiamond | last post by:
Hi, I have a table called Hosts. The Hosts table contains the following fields: Each field represents a step in the project. The tech that completes each step initials the respective...
1
by: aman909 | last post by:
Hi, I would like to calculate the total on a form. But the problem is that i need it to calculate from 5 text boxes on a form, but not all this text boxes are filled out depending on a client. ...
4
by: sumit kale | last post by:
Hi, Can somebody help me resolve my problem ? I am getting error when calculating total using unbound textfiled in subform. I have a main form called purchase_register_master and a subform...
0
by: Steffrobers | last post by:
I have a PO form that has a invoice subform. Within that PO you can have multiple invoices that have materials, labor freight and tax. I'm trying to total all the materials, all the freight, tax...
0
by: tnynyn | last post by:
I have created a form with two datetimepicker showing only hours (start and end times). I have timespan calculating the total hours, but when it goes to the next day, it adds 24 hours. For example,...
0
by: Saboor Mohideen | last post by:
Can someone tell me which event occurs on Total TextBox: Main Form Name Type Event Used Event Set All three textboxes are bound to a table CashAmount TextBox ...
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
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...
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
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...
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,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...
0
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...

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.