Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Microsoft Office > Access and Access VBA > Access
Password Reminder
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old June 1st, 2007, 04:22 PM
Registered User
Join Date: Jun 2007
Location: , , .
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.

Reply With Quote
  #2 (permalink)  
Old June 2nd, 2007, 11:40 PM
Authorized User
Join Date: May 2006
Location: , , India.
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.

Reply With Quote
  #3 (permalink)  
Old June 4th, 2007, 11:10 AM
Registered User
Join Date: Jun 2007
Location: , , .
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?

Reply With Quote
  #4 (permalink)  
Old June 4th, 2007, 12:49 PM
Friend of Wrox
Points: 9,611, Level: 42
Points: 9,611, Level: 42 Points: 9,611, Level: 42 Points: 9,611, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Mar 2004
Location: Washington, DC, USA.
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?

Reply With Quote

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

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

All times are GMT -4. The time now is 05:14 PM.

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