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

Indicating skips in sequential numbers on a report

Surely someone has done this before, and I am guessing there is a
simple solution that is eluding me. I have a simple report based on a
recordset. For each record there is a field (RecNum) that is basically
a sequential number from 1 to n. Occasionally there are skips between
numbers. I would like to print 'record skipped' for each record
missing from the sequence. For example, if there were no records
numbered 5 and 6 in a sequence of records numbered 1 to 7 I'd like to
output something like the following:

1...
2...
3...
4...
record skipped
record skipped
7...

Short of creating dummy records, how might I achieve this? Thanks.

Bruce

Jan 18 '07 #1
4 2079
Ben
I think the easiest solution is to tweak the recordset for your report.

How about creating a master set of record sequences and then joining
them to your actual report? That way you have real data for a query
based comparison.

e.g.
Master table
Record Seq
1
2
3

Now your real record set
real records
Record Seq Title
1 Record 1
3 Record 2

Now set the Recordset for your report to this query:
SELECT [master table].[Record Seq], [real records].Title
FROM [master table] LEFT JOIN [real records] ON [master table].[Record
Seq] = [real records].[Record Seq];

Ahh, but now you want to display "record skipped" if there is no entry
for that record. So use an if statement to add that text and use this
query as your report recordset:
SELECT [master table].[Record Seq], IIf(IsNull([Title])=True,"record
skipped",[title]) AS [Report Title]
FROM [master table] LEFT JOIN [real records] ON [master table].[Record
Seq] = [real records].[Record Seq];

And there you have it...

Bruce wrote:
Surely someone has done this before, and I am guessing there is a
simple solution that is eluding me. I have a simple report based on a
recordset. For each record there is a field (RecNum) that is basically
a sequential number from 1 to n. Occasionally there are skips between
numbers. I would like to print 'record skipped' for each record
missing from the sequence. For example, if there were no records
numbered 5 and 6 in a sequence of records numbered 1 to 7 I'd like to
output something like the following:

1...
2...
3...
4...
record skipped
record skipped
7...

Short of creating dummy records, how might I achieve this? Thanks.

Bruce
Jan 18 '07 #2
On 18 Jan 2007 09:35:46 -0800, Bruce wrote:
Surely someone has done this before, and I am guessing there is a
simple solution that is eluding me. I have a simple report based on a
recordset. For each record there is a field (RecNum) that is basically
a sequential number from 1 to n. Occasionally there are skips between
numbers. I would like to print 'record skipped' for each record
missing from the sequence. For example, if there were no records
numbered 5 and 6 in a sequence of records numbered 1 to 7 I'd like to
output something like the following:

1...
2...
3...
4...
record skipped
record skipped
7...

Short of creating dummy records, how might I achieve this? Thanks.

Bruce
See Microsoft KnowledgeBase article:
210234 "ACC2000: How to Flag Out-of-Sequence Numbers on a Report"
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Jan 18 '07 #3

Ben wrote:
I think the easiest solution is to tweak the recordset for your report.

How about creating a master set of record sequences and then joining
them to your actual report? That way you have real data for a query
based comparison.

e.g.
Master table
Record Seq
1
2
3

Now your real record set
real records
Record Seq Title
1 Record 1
3 Record 2

Now set the Recordset for your report to this query:
SELECT [master table].[Record Seq], [real records].Title
FROM [master table] LEFT JOIN [real records] ON [master table].[Record
Seq] = [real records].[Record Seq];

Ahh, but now you want to display "record skipped" if there is no entry
for that record. So use an if statement to add that text and use this
query as your report recordset:
SELECT [master table].[Record Seq], IIf(IsNull([Title])=True,"record
skipped",[title]) AS [Report Title]
FROM [master table] LEFT JOIN [real records] ON [master table].[Record
Seq] = [real records].[Record Seq];

And there you have it...
Thank you Ben. I had considered manipulating the recordset itself
(essentially loading it with dummy records as you describe). I had
hoped to find a solution that did not require this and instead would
perhaps utilize the report's detail format and/or print events along
with a counter of some kind.

Bruce

Jan 18 '07 #4

fredg wrote:
On 18 Jan 2007 09:35:46 -0800, Bruce wrote:
Surely someone has done this before, and I am guessing there is a
simple solution that is eluding me. I have a simple report based on a
recordset. For each record there is a field (RecNum) that is basically
a sequential number from 1 to n. Occasionally there are skips between
numbers. I would like to print 'record skipped' for each record
missing from the sequence. For example, if there were no records
numbered 5 and 6 in a sequence of records numbered 1 to 7 I'd like to
output something like the following:

1...
2...
3...
4...
record skipped
record skipped
7...

Short of creating dummy records, how might I achieve this? Thanks.

Bruce

See Microsoft KnowledgeBase article:
210234 "ACC2000: How to Flag Out-of-Sequence Numbers on a Report"
--
Fred
Please respond only to this newsgroup.
I do not reply to personal e-mail
Thanks Fred. This might be something I can modify to meet my needs.

Bruce

Jan 18 '07 #5

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

Similar topics

6
by: Jenn L | last post by:
I have a database that is pre-populated with sequential part numbers. As people reserve the parts I update a flag to show the # is no longer available. Now they want the ability to take out a...
2
by: Eddy Bee | last post by:
Hi there, I'm encountering an inexplicable problem with page formatting in reports. Here's the easiest way to explain it: The Detail section of my report contains two elements: And let's...
5
by: Lapchien | last post by:
I have list of numbers in a table (originally from autonumber in a different database) from 1 to 1,000,000. The list is not in sequential order - there are loads of numbers missing. How can I...
1
by: systems analyst | last post by:
This is my modification on an original solution posted by Trevor Best (trevor@microprism.com) back in 1996. Insert the following code in a Module in your Access data base. Option Compare...
14
by: amywolfie | last post by:
Hi All: I know this is simple, but I just can't seem to get there: I need to sort a table by a text field (txtDescription), then assign sequential numbers to the field SEQUENCE in table. ...
3
by: David Garamond | last post by:
Am I correct to assume that SERIAL does not guarantee that a sequence won't skip (e.g. one successful INSERT gets 32 and the next might be 34)? Sometimes a business requirement is that a serial...
0
by: Scott | last post by:
I need to have a field to generate the report number with the following format:- The first part consists of four digits for each year. It could be obtained from the date field entered manually....
1
maxamis4
by: maxamis4 | last post by:
Hello folks, I have two forms a parent form and a subform. The parent form is an unbound form while the subform is a form that contains all a list of what I like to call 'in stock ' phone...
10
by: Hulm1 | last post by:
I have a form "Job_Edit" with a subform. The subform called "JobTask" is a continuous form and includes a look-up combo box for a range of tasks. After I choose say 4 separate tasks, I can print a...
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: 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
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...
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.