Computing.Net > Forums > Database > Access 2000 query

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Access 2000 query

Reply to Message Icon

Name: Betty Mc Kenzie
Date: June 28, 2007 at 08:28:04 Pacific
OS: Win XP
CPU/Ram: 2 gig
Product: Dell
Comment:

I print a daily report showing the production figures for each item. I now want to print, an accumulation of the production thus far. For example if I print todays report it should also show me total production for the month up to today. If I have to reprint a report from lastweek, I should be seeing the production for that day and the accumulative production up to that point. I have a query that runs by date which shows me the production for the day but the same production figures for that day appear in the accumulative field. It does not add the previous days production figures to the accumulative. Hope this explaination helps. Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: pingy
Date: July 3, 2007 at 14:51:51 Pacific
Reply:

Betty,

What you explain is, I think, what is called a "running total". SQL doesn't remember values from previous records so you'll need to solve this in your report.

Open the code window for the report. There's a button for this or choose menu [Extra][Macro][Visual Basic Editor] or press Alt+F11.

In the globals section (top of code window) type:
Dim dblTotal As Double
(or another appropiate type)

Select from the listbox at the top left of the window "Report". There's now code for the OnLoad event. Type inside this:
dblTotal = 0

Let's assume your value field is called "MyValue" and you have placed a textbox named txtRunTotal on your report.

From the left Listbox select "Detail" and from right Listbox select "Format".
Now you have code for an event when data is formatted for printing. Here you type:
dblTotal = dblTotal + [MyValue]
txtRunTotal = dblTotal

Run the report.
This should do the tric.


0
Reply to Message Icon

Related Posts

See More







Post Locked

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.


Go to Database Forum Home


Sponsored links

Ads by Google


Results for: Access 2000 query

Access 2000 query result www.computing.net/answers/dbase/access-2000-query-result/272.html

MS Access 2000 export a record www.computing.net/answers/dbase/ms-access-2000-export-a-record/193.html

MS Access 2000 annoys me www.computing.net/answers/dbase/ms-access-2000-annoys-me/104.html