473,804 Members | 3,138 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Numbering Records Based On Another Field In A Report

I posted this yesterday and it seems like a moderator has thrown it in
another thread. This is a totally different question to the one asked
in that thread, so I'm posting it again. It is not a simple
"numbering records on a report" question. It is more complex than
that.

I have a report that shows the results of a query. One of the fields
is an autonumber field from the query which shows for instance: 120,
121 , 122 for 3 records. Is there a way to have another field that
shows the numbering starting from 1 ie. 1, 2, 3? If the records were
sorted so that the first field showed the records in the order: 121,
120, 122 then I would need the second field would show them numbered
as 2, 1, 3. I would also need the second field to follow the numbering
sequence 1, 2, 3 even if the first field skipped a number eg. 120,
122, 123.

Thanks in advance.
Nov 12 '05 #1
2 2310
"Wayne Aprato" wrote
I posted this yesterday and it seems
like a moderator has thrown it in
another thread.


It may, indeed, _seem_ so, but that is not the case because
comp.databases. ms-access is unmoderated and no one can "rearrange" the
messages. Either you inadvertently responded to a message in the other
thread, or you had an exact duplicate of the subject in that thread and your
newsreader uses subject to identify the thread (this is the case with
http://groups.google.com -- there seem to be some exceedingly long threads
there, but on examination, it turns out to be a large number of actual
threads appended one after the other).

Larry Linson
Microsoft Access MVP
Nov 12 '05 #2
You _can_ create a record number in a Query, using a user-defined function,
but you have to be careful -- a given record may be processed more than once
because of the way the query engine works, so you'll need to check the field
on which you are ordering the Query records within the function.

(Unfortunately, my example of this was lost in the course of a change of
primary computers.)

Almost always, there's some other way than using a record number to
accomplish one's purpose. If you'll explain what you need to do, rather than
how you'd like to do it, perhaps someone can suggest an alternative
approach. If not, well, you can create those numbers as I describe above.

Larry Linson
Microsoft Access MVP
Larry Linson
Microsoft Access MVP

"Wayne Aprato" <cq*******@volc anomail.com> wrote in message
news:4d******** *************** ***@posting.goo gle.com...
I posted this yesterday and it seems like a moderator has thrown it in
another thread. This is a totally different question to the one asked
in that thread, so I'm posting it again. It is not a simple
"numbering records on a report" question. It is more complex than
that.

I have a report that shows the results of a query. One of the fields
is an autonumber field from the query which shows for instance: 120,
121 , 122 for 3 records. Is there a way to have another field that
shows the numbering starting from 1 ie. 1, 2, 3? If the records were
sorted so that the first field showed the records in the order: 121,
120, 122 then I would need the second field would show them numbered
as 2, 1, 3. I would also need the second field to follow the numbering
sequence 1, 2, 3 even if the first field skipped a number eg. 120,
122, 123.

Thanks in advance.

Nov 12 '05 #3

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

Similar topics

3
2842
by: David B | last post by:
I am creating invoices for an app I am busy with. The transactions for the invoice come from 2 tables which store Sales and Facilities Hire. The current arrangement is that I create a temp table using append queries to get transactions from the 2 tables between selected dates. then draw these into a report grouped by the Sales and Facilities Hire This all works fine. However the customer requires invoices (reports) to have consecutive...
1
1911
by: Wayne Aprato | last post by:
I have a report that shows the results of a query. One of the fields is an autonumber field from the query which shows for instance: 120, 121 , 122 for 3 records. Is there a way to have another field that shows the numbering starting from 1 ie. 1, 2, 3? If the records were sorted so that the first field showed the records in the order: 121, 120, 122 then I would need the second field would show them numbered as 2, 1, 3. I would also need...
2
1891
by: Rob | last post by:
Hi, I have an access 2000 application.I generate a report with Query as the recordsource.This report is the analysis of data Vendorwise.The vendors are listed in ascending order alphabetically,like AT&T,CTI,DALLAS...Verizon etc.At present in my report,I have a running serial number 1,2 etc.But i need to have a numbering where if there are 5 items of AT&T,it will be 1 to 5 and then if the next vendor is ACT it should again start from...
1
2265
by: Rinee | last post by:
Hi, I have a database of a bunch of contractors who have signed a safety agreement with us, their contact info, their insurance info, etc. Each was assigned an ID number as the main key. Each contractor agreement has an expiry date. I have a report that lists the contractors and a couple other relevant fields for reference for our company employees. But I don't want a contractor to appear on this report (which looks like a list of...
20
2070
by: Prakash | last post by:
Hi ! I have a field "sub_tran_no" in my form in continuous view. When the user presses a button "Re-Number", I'd like to: 1) Save the current record pointer position 2) Save the current field which has focus 3) go to the top of the recordset & start re-numbering the "sub_tran_no" field with the values 1,2,3, until eof.
3
2605
by: Chris | last post by:
Before I started to create table, etc to track unique form field record number assigments I thought I'd check to see if there is now a better way to do this in .NET. I have a parent form (table) and children form (table). Relationship equals one to many. I'd like to auto number the fields accordingly and traditionaly I assign a unique number based on a table value that I retrieve + 1. i.e. Parent record field value = 1 Children record...
1
3739
by: RussCRM | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for statistical purposes. I've been using Here’s the situation: I have two main tables: Guest (stores data such as GuestID, First Name, Last Name, etc.) and Services (stores data such as the type of service the guest used (Shelter Bed, Lunch, Dinner,...
2
4453
by: srusskinyon | last post by:
I need some help getting unique records from our database! I work for a small non-profit homeless shelter. We keep track of guest information as well as what services we have offered for statistical purposes. I've been using Here's the situation: I have two main tables:
1
1456
by: lawitt | last post by:
I have a MakeTable query whose resulting table i'm using in a crosstab query. The fields in the crosstab are constantly changing (weekly), so my ultimate goal has been to somehow create a dynamic report that takes into consideration the ever changing fields. that's been VERY tricky. I've managed to get the MakeTable query to only display my 'top 10' fields and i've created a 'static' report that references a calculated field (Number) in that...
0
9706
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9579
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10575
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10319
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
7616
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6851
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4297
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 we have to send another system
2
3816
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2990
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.