473,396 Members | 1,693 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.

Only print last detail line for primary key, suppress all others

Hi,

I have a report that has a query as its record source.
The query picks up records from a table that meet certain criterion.
The report then counts how many records there are for each key (room
number) - but does some calculating by date to see whether to increment
the count.

Then the report lists the Room Number, and the Count.
The way it is now, if the count for a room number is 4, it will
display:
Room Count
-------- --------
200 1
200 2
200 3
200 4

What I'd like to do is ONLY print the last line.

I don't think I can do this via my query, because Count is not on my
table and is calculated in my report's VBA. The logic I use is: if
one record and the next have an ActivityDate within 11 days of each
other, the count is 1. If it is over 11 days, the count is 2. And so
on with the next record, etc. In my VBA, I check record-by-record. I
don't think this logic can be done in a query, can it?

Is there a way to do this, either by my report (and only print the last
detail line for a room number), or by query?

Thanks so much for any help!
Lori

Oct 16 '06 #1
1 1725
lorirobn wrote:
Hi,

I have a report that has a query as its record source.
The query picks up records from a table that meet certain criterion.
The report then counts how many records there are for each key (room
number) - but does some calculating by date to see whether to increment
the count.

Then the report lists the Room Number, and the Count.
The way it is now, if the count for a room number is 4, it will
display:
Room Count
-------- --------
200 1
200 2
200 3
200 4

What I'd like to do is ONLY print the last line.

I don't think I can do this via my query, because Count is not on my
table and is calculated in my report's VBA. The logic I use is: if
one record and the next have an ActivityDate within 11 days of each
other, the count is 1. If it is over 11 days, the count is 2. And so
on with the next record, etc. In my VBA, I check record-by-record. I
don't think this logic can be done in a query, can it?

Is there a way to do this, either by my report (and only print the last
detail line for a room number), or by query?

Thanks so much for any help!
Lori
Yes, it can be done. But you'll need to know how to program. See
"MoveLayout, NextRecord, PrintSection Properties" in help or create a
code mode and enter/highlight the word MoveLayout and press the F1 key
to get to the help topic.

You'd probably need to create a group on Room. Have a global variable
the is reset when a new room is found. You'll need to know how the
count of the rooms per group. Then you simply move to the next record,
but the MoveLayout and PrintSections set to false if not equal to the
last room record.

Or, in the recordsource query of the report call a function that returns
a true or false on whether or not the record is to be printed.
PrintRec : DoIPrintIt([Room], [RoomRecID])
and write a public function to return true or false to print.

Oct 16 '06 #2

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

Similar topics

9
by: Paul Watson | last post by:
I thought that using a comma at the end of a print statement would suppress printing of a newline. Am I misunderstanding this feature? How can I use print and not have a newline appended at the...
14
by: Marcin Ciura | last post by:
Here is a pre-PEP about print that I wrote recently. Please let me know what is the community's opinion on it. Cheers, Marcin PEP: XXX Title: Print Without Intervening Space Version:...
8
by: baustin75 | last post by:
Posted: Mon Oct 03, 2005 1:41 pm Post subject: cannot mail() in ie only when debugging in php designer 2005 -------------------------------------------------------------------------------- ...
5
by: Bryan Ax | last post by:
I have a page that has two copies of the same control in it. The control is: BorrowerControl the two references to it in the page are bControl1 cobControl1
9
by: cendrizzi | last post by:
Hi all, I've read some stuff on this but can't seem to come up with a solution that works right. I have a semi-mature (yet very large and robust) internal web application that currently only...
3
by: Sparkee | last post by:
I am in a conundrum and I am not sure how to do what I want to do. In short in a report I want either a) everything in one long line or b) only the detail section to be columnar More detail on...
3
by: notejam | last post by:
Hi, I am having a problem with print statements always cause a line feed. I need to print a line of text, then the next print statement will start printing where the last one stopped rather than...
69
by: Edward K Ream | last post by:
The pros and cons of making 'print' a function in Python 3.x are well discussed at: http://mail.python.org/pipermail/python-dev/2005-September/056154.html Alas, it appears that the effect of...
8
by: gregpinero | last post by:
I'm running code via the "exec in context" statement within a much larger program. What I would like to do is capture any possible errors and show a pretty traceback just like the Python...
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
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...
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
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.