473,396 Members | 2,068 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.

Report Totals

Tom
All:

I have a report that lists quantities of stuff used over the course of
a year and it is grouped on each month. In the group footer I want to
insert the total for the month - easy stuff so far.

The part that has me stumped is that the units of use for each record
may not be the same (e.g., we may have one record at 5 lbs and one
with 4 kg). I've gone to some length in the forms for entering data
to prevent this, but I subscribe to the philosophy that nothing is
idiot proof - better idiots are unleashed very day. So what I want to
do is hide the totals if all the units aren't the same for the month
(since they would be meaningless). What is the best way to accomplish
this?

I've thought about running a query against the reports recordsource to
give me a count of the number of unique units - if I get more than 1,
I suppress the totals for all the months, but am not sure that is the
best approach.

For example:

I want totals in this case:
Jun 2007
Material 1 300 gal 3000 lbs
Material 2 200 gal 2500 lbs
Total 5500 lbs

I don't in this case:
Jun 2007
Material 1 300 gal 3000 lbs
Material 2 200 liter 250 kilograms

Any thoughts? Thanks

Tom

Jun 11 '07 #1
2 2216
Tom <rt*****@swbell.netwrote in
news:11**********************@k79g2000hse.googlegr oups.com:
All:

I have a report that lists quantities of stuff used over the
course of a year and it is grouped on each month. In the
group footer I want to insert the total for the month - easy
stuff so far.

The part that has me stumped is that the units of use for each
record may not be the same (e.g., we may have one record at 5
lbs and one with 4 kg). I've gone to some length in the forms
for entering data to prevent this, but I subscribe to the
philosophy that nothing is idiot proof - better idiots are
unleashed very day. So what I want to do is hide the totals
if all the units aren't the same for the month (since they
would be meaningless). What is the best way to accomplish
this?

I've thought about running a query against the reports
recordsource to give me a count of the number of unique units
- if I get more than 1, I suppress the totals for all the
months, but am not sure that is the best approach.

For example:

I want totals in this case:
Jun 2007
Material 1 300 gal 3000 lbs
Material 2 200 gal 2500 lbs
Total 5500 lbs

I don't in this case:
Jun 2007
Material 1 300 gal 3000 lbs
Material 2 200 liter 250 kilograms

Any thoughts? Thanks

Tom
In the report declarations, dim two variables per column, say
st1stum1 as string
bmixedUM1 as boolean.

In the month header_Format event, grab the first UM for the
month, and set bMixedUM to false.

In the details_format put something like
if me.UM <stFirstUM1 then bMixedUM1 = true

then you can code your total.visible property to false if
bMixedUM is true.

However, another solution is to build a lookup table of
UM_Equivalences.
with all your UnitSets,
so that if you want to total on gallons
um Factor
GAL 1.00
Liter 3.55
DRUM .0181818

so you can multiply the measurement by the factor
and get a valid total.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account from http://www.teranews.com

Jun 12 '07 #2
Tom
On Jun 11, 6:44 pm, Bob Quintal <rquin...@sPAmpatico.cawrote:
Tom <rtmn...@swbell.netwrote innews:11**********************@k79g2000hse.google groups.com:


All:
I have a report that lists quantities of stuff used over the
course of a year and it is grouped on each month. In the
group footer I want to insert the total for the month - easy
stuff so far.
The part that has me stumped is that the units of use for each
record may not be the same (e.g., we may have one record at 5
lbs and one with 4 kg). I've gone to some length in the forms
for entering data to prevent this, but I subscribe to the
philosophy that nothing is idiot proof - better idiots are
unleashed very day. So what I want to do is hide the totals
if all the units aren't the same for the month (since they
would be meaningless). What is the best way to accomplish
this?
I've thought about running a query against the reports
recordsource to give me a count of the number of unique units
- if I get more than 1, I suppress the totals for all the
months, but am not sure that is the best approach.
For example:
I want totals in this case:
Jun 2007
Material 1 300 gal 3000 lbs
Material 2 200 gal 2500 lbs
Total 5500 lbs
I don't in this case:
Jun 2007
Material 1 300 gal 3000 lbs
Material 2 200 liter 250 kilograms
Any thoughts? Thanks
Tom

In the report declarations, dim two variables per column, say
st1stum1 as string
bmixedUM1 as boolean.

In the month header_Format event, grab the first UM for the
month, and set bMixedUM to false.

In the details_format put something like
if me.UM <stFirstUM1 then bMixedUM1 = true

then you can code your total.visible property to false if
bMixedUM is true.

However, another solution is to build a lookup table of
UM_Equivalences.
with all your UnitSets,
so that if you want to total on gallons
um Factor
GAL 1.00
Liter 3.55
DRUM .0181818

so you can multiply the measurement by the factor
and get a valid total.

--
Bob Quintal

PA is y I've altered my email address.

--
Posted via a free Usenet account fromhttp://www.teranews.com- Hide quoted text -

- Show quoted text -
Thanks for the solution - much more elegant than my initial thoughts.

Tom

Jun 12 '07 #3

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

Similar topics

3
by: John Baker | last post by:
Hi: I have a situation where I have a series of time records (one or more per day) for a number of projects. Each record has an identification for the activity conducted during the period...
2
by: Steven Stewart | last post by:
Hi there, I don't have a lot of experience with this so I am looking for some help. I have a form that allows a user to choose the options she wants. How do I set it up so that the report...
1
by: Nathan Bloomfield | last post by:
Does anyone know if there is any documentation which relates to Access2k + ? or can anyone help adjust the code? I am having trouble converting the DAO references. TITLE :INF: How to...
1
by: fixedpower | last post by:
I have an Access 2000 DB for a financial company. I have the table structure completed, but I am having trouble with the report. Basically, I have a Client tbl, a StockShares tbl, and a...
8
by: sara | last post by:
Hi - I have looked at all posts and tried both Allen Browne's Report Sorting at run Time ( Select Case Forms!frmChooseSort!grpSort Case 1 'Name Me.GroupLevel(0).ControlSource = "LastName"...
4
by: lorirobn | last post by:
Hi, I have a report displaying items that are missing from a room. I created 2 queries, the first getting the items IN the room, and the second being an "unmatched" query that references the...
4
by: Micheal | last post by:
Greetings Access Group, Being relatively new to Access, I try to work through problems on my own and have been very successful, although I have a conundrum that I have been working on for two days...
5
prn
by: prn | last post by:
Hi folks, I'm looking for a little advice here. I need to create a report that is totals only, with no detail records. I have a database with a lot of individuals (people) and the report has to...
0
by: zufie | last post by:
Hi, Here are the specifics of the Report which I am to create. Reports for Callers - from Begin Date to End Date of Reporting Period and by respective County: * List Language preference of...
14
ollyb303
by: ollyb303 | last post by:
Hi, I am trying to create a dynamic crosstab report which will display number of calls handled (I work for a call centre) per day grouped by supervisor. I have one crosstab query (Query1) which...
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
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
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...
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
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
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
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,...

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.