Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Access Discussion of Microsoft Access database design and programming. See also the forums for Access ASP and Access VBA.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Access section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old June 1st, 2007, 04:22 PM
Registered User
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Access sequential numbering in a query

I am in need of a way to number a large number of records in MS Access. The numbering needs to restart with each new client. E.g. In the table below, client 56789 is open for 3 days. In the SeqNum column I need the records to read 1, 2, and 3 for the three ServiceDays listed. Same for client 78965, I need their records to be numbered 1,2,3 and 4. How can this be done?

Client ServiceDay NumofDays SeqNum
56789 4/25/2007 3
56789 4/24/2007 3
56789 4/23/2007 3
78965 1/13/2007 4
78965 1/12/2007 4
78965 1/11/2007 4
78965 1/10/2007 4

Thank you ahead of time.

Old June 2nd, 2007, 11:40 PM
Authorized User
Join Date: May 2006
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Ashfaque

Why you don't want perform it in a report?. That would work the same you need.

Old June 4th, 2007, 11:10 AM
Registered User
Join Date: Jun 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts

Because I will be appending the records to another table that will be used by future queries.

Does anyone know how to do this in a query? or using code?

Old June 4th, 2007, 12:49 PM
Friend of Wrox
Join Date: Mar 2004
Posts: 3,069
Thanks: 0
Thanked 10 Times in 10 Posts

You could do this quite easily in code. For data that is already there, you will need some other parameter to sequence the records, unless you just want to take, say 4 records for a customer for a day, and randomly number them 1, 2, 3, 4.

If you add this number each time a record is created (on the form's Before Insert event) then it will go smoothly.

How do you want to proceed?


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sequential numbering help gear1 Access 1 April 9th, 2007 06:31 AM
I need to implement Sequential File Access jacksmith1 C# 0 October 2nd, 2006 06:28 AM
Create Sequential Numbering That Does not Skip mrslockdown2003 Access 4 May 11th, 2005 11:45 AM
Sequential numbering a non auto number field dbartelt Access 3 May 5th, 2005 02:56 PM
Sequential Row numbering in queriws civa Access 5 March 7th, 2005 02:13 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.