Microsoft Access Forums

Go Back   Microsoft Access Forums > Access Forums > Programming

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 04-06-2009, 07:11 AM
KramerJ KramerJ is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Mar 2009
Location: Las Vegas, NV
Posts: 15
KramerJ is on a distinguished road
Default Assign A Sequential Number To A Table Row

I have a table that has four fields and 39k rows. The first field is for the sequential number. The fourth field has a different entry varing from the 177th to 185th row. Using VBA how can I seqentially insert a number from 1 to n based on the fourth field entry. Please help.
Reply With Quote
  #2  
Old 04-06-2009, 08:37 AM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,264
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

I would look into Stephan Lebans solution.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #3  
Old 04-06-2009, 10:00 AM
KramerJ KramerJ is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Mar 2009
Location: Las Vegas, NV
Posts: 15
KramerJ is on a distinguished road
Default Assign A Sequential Number To A Table Row

Thanks RG for you reply. I am not that versed in VBA, but will the code I looked at in the Lebans' site serialize all the row's start to end or will the 'keyname' be used for my 4th field condition to restart the serialize function. (ex. Serial # 1-177, field 4 = xxyyxx // Serial 1-177, field 4 = zzxxyy,,etc.)
Reply With Quote
  #4  
Old 04-06-2009, 10:11 AM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,264
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

Serialize the Recordset from beginning to end. I guess I do not understand what you need. I don't understand this:
Quote:
(ex. Serial # 1-177, field 4 = xxyyxx // Serial 1-177, field 4 = zzxxyy,,etc.)
Where is the Serial #?
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #5  
Old 04-06-2009, 11:48 AM
KramerJ KramerJ is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Mar 2009
Location: Las Vegas, NV
Posts: 15
KramerJ is on a distinguished road
Default

RG - (Field-1) Serial # 1-177, field 4 = xxyyxx // Serial 1-177, field 4 = zzxxyy,,etc.)

Field-1 Field-2 Field-3 Field-4
1 xx xx xxyyxx
. xxyyxx
177 xxyyxx
1 zzxxyy
. zzxxyy
177 zzxxyy
......and so on

sorry for the confusion and not explaining clearly. Does this help.
Thanks,
Reply With Quote
  #6  
Old 04-06-2009, 11:49 AM
KramerJ KramerJ is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Mar 2009
Location: Las Vegas, NV
Posts: 15
KramerJ is on a distinguished road
Default

RG - Lost the formatting in my last post, I will try again...
Reply With Quote
  #7  
Old 04-06-2009, 11:54 AM
KramerJ KramerJ is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Mar 2009
Location: Las Vegas, NV
Posts: 15
KramerJ is on a distinguished road
Default

  1. RG - (Field-1) Serial # 1-177, field 4 = xxyyxx // Serial 1-177, field 4 = zzxxyy,,etc.)


    Field-1 Field-2 Field-3 Field-4
    ..1 ....... xx........xx....xxyyxx
    ..-...........................xxyyxx
    177..........................xxyyxx
    ..1.......................... zzxxyy
    ..-...........................zzxxyy
    177..........................zzxxyy
    ......and so on

    sorry for the confusion and not explaining clearly. Does this help.
    Thanks,
Reply With Quote
  #8  
Old 04-06-2009, 03:24 PM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,264
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

I think you will need to roll you own on this issue using the DMax() function.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #9  
Old 04-07-2009, 01:35 PM
KramerJ KramerJ is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Mar 2009
Location: Las Vegas, NV
Posts: 15
KramerJ is on a distinguished road
Default

Thanks RG for you replies.
Reply With Quote
  #10  
Old 04-07-2009, 03:56 PM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,264
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

Post back here it you are still having difficulties.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
  #11  
Old 04-08-2009, 06:38 AM
KramerJ KramerJ is offline Windows XP Access 2003 (version 11.0)
Novice
 
Join Date: Mar 2009
Location: Las Vegas, NV
Posts: 15
KramerJ is on a distinguished road
Default

Unfortunetly yes...I even posted on the MS Office Forum, EXCEL but haven't received any replies. I"'ve been just digging through manuals and just not getting any responses from other forums. You would think this would not be such an envolved issue: creating sequential number for a number of rows conditioned on a value in another cell and continue the process for x number of rows.
Reply With Quote
  #12  
Old 04-08-2009, 06:48 AM
RuralGuy's Avatar
RuralGuy RuralGuy is online now Windows 7 Access 2007 (version 12.0)
Administrator
 
Join Date: Mar 2007
Location: 8300' in the Colorado Rocky Mountains
Posts: 4,264
RuralGuy will become famous soon enoughRuralGuy will become famous soon enough
Default

It is not difficult. A DMax() with a WhereClause is all it takes.
__________________
(RG for short) aka Allan Bunch MS Access MVP - WinXP Pro, Win7 - acXP, ac07
If your issue is resolved...follow this link for directions on how to use the Solved thread tool!
Teaching is not filling a bucket but lighting a fire. Borrowed quote..."Docendo discimus"
Reply With Quote
Reply

Bookmarks

Thread Tools
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 On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
need query to assign sales leads to reps?? RickM Queries 0 03-12-2009 12:44 PM
Combox box returns ID number in table instead of names JP_101 Forms 3 02-20-2009 11:28 AM
How can I get a calculated field to return the number back to the table? FestoAccessBuilder Access 1 02-05-2009 01:53 PM
help creating a sequential number for records in a table or query rthomas Access 1 01-31-2009 07:43 AM
create sequential id proudestmnky1 Programming 0 12-15-2008 09:10 PM


All times are GMT -8. The time now is 03:00 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.