A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Update ID numbers that are not autonumber



 
 
Thread Tools Display Modes
  #1  
Old November 4th, 2008, 01:44 AM posted to microsoft.public.access
CH
external usenet poster
 
Posts: 54
Default Update ID numbers that are not autonumber

Hi, I'm trying to update an ID field in a table. The new record starts with
an ID of 121888 and I'd like to update 12,010 records sequentially from this
number. Does anyone know how to do this?
Thanks in advance.
  #2  
Old November 4th, 2008, 02:04 AM posted to microsoft.public.access
John W. Vinson
external usenet poster
 
Posts: 18,261
Default Update ID numbers that are not autonumber

On Mon, 3 Nov 2008 17:44:00 -0800, CH wrote:

Hi, I'm trying to update an ID field in a table. The new record starts with
an ID of 121888 and I'd like to update 12,010 records sequentially from this
number. Does anyone know how to do this?
Thanks in advance.


What's in the field NOW? How would you determine which existing record should
e 121889?
--

John W. Vinson [MVP]
  #3  
Old November 4th, 2008, 04:36 AM posted to microsoft.public.access
CH
external usenet poster
 
Posts: 54
Default Update ID numbers that are not autonumber

Hi John,
There are numbers in the field at the moment. I appended a new table with
12,010 records and would like to carry on the ID numbering. It doesn't really
matter what new record is 121889, or their order, just as long as all the new
records get a unique ID number.
Thanks,
CH

"John W. Vinson" wrote:

On Mon, 3 Nov 2008 17:44:00 -0800, CH wrote:

Hi, I'm trying to update an ID field in a table. The new record starts with
an ID of 121888 and I'd like to update 12,010 records sequentially from this
number. Does anyone know how to do this?
Thanks in advance.


What's in the field NOW? How would you determine which existing record should
e 121889?
--

John W. Vinson [MVP]

  #4  
Old November 4th, 2008, 05:17 AM posted to microsoft.public.access
Larry Linson
external usenet poster
 
Posts: 3,112
Default Update ID numbers that are not autonumber

Are the numbers sequential, from which you wish to "carry on the ID
numbering"? What number format are they? Or, indeed, is it a text field
with numeric characters? Do you have a batch of new, unnumbered records, or
are you looking for an approach for manual entry of each record.

Some common suggestions for which you can check help:

DMAX is a domain aggregate function that returns the maximum value in a
field in a table. Retrieve that, add 1 to it, and place that in the ID
field. When that update is complet, the next DMAX will return the number you
just inserted. You can also use DMAX in a loop in DAO or ADO VBA code, if
you have a "batch" of existing records to number.

Larry Linson
Microsoft Office Access MVP


"CH" wrote in message
...
Hi John,
There are numbers in the field at the moment. I appended a new table with
12,010 records and would like to carry on the ID numbering. It doesn't
really
matter what new record is 121889, or their order, just as long as all the
new
records get a unique ID number.
Thanks,
CH

"John W. Vinson" wrote:

On Mon, 3 Nov 2008 17:44:00 -0800, CH
wrote:

Hi, I'm trying to update an ID field in a table. The new record starts
with
an ID of 121888 and I'd like to update 12,010 records sequentially from
this
number. Does anyone know how to do this?
Thanks in advance.


What's in the field NOW? How would you determine which existing record
should
e 121889?
--

John W. Vinson [MVP]



  #5  
Old November 4th, 2008, 08:30 PM posted to microsoft.public.access
CH
external usenet poster
 
Posts: 54
Default Update ID numbers that are not autonumber

Hi Larry,
Thanks for your suggestions.
To answer your questions: Yes the numbers are sequential that I'd like to
carry on the ID numbering with. The field is a 'number' field. Yes I have a
batch of new unnumbered records. I'm not looking to do it manually as there
are over 12,000 new records.
Would I use DMAX in a query?
Thanks, CH

"Larry Linson" wrote:

Are the numbers sequential, from which you wish to "carry on the ID
numbering"? What number format are they? Or, indeed, is it a text field
with numeric characters? Do you have a batch of new, unnumbered records, or
are you looking for an approach for manual entry of each record.

Some common suggestions for which you can check help:

DMAX is a domain aggregate function that returns the maximum value in a
field in a table. Retrieve that, add 1 to it, and place that in the ID
field. When that update is complet, the next DMAX will return the number you
just inserted. You can also use DMAX in a loop in DAO or ADO VBA code, if
you have a "batch" of existing records to number.

Larry Linson
Microsoft Office Access MVP


"CH" wrote in message
...
Hi John,
There are numbers in the field at the moment. I appended a new table with
12,010 records and would like to carry on the ID numbering. It doesn't
really
matter what new record is 121889, or their order, just as long as all the
new
records get a unique ID number.
Thanks,
CH

"John W. Vinson" wrote:

On Mon, 3 Nov 2008 17:44:00 -0800, CH
wrote:

Hi, I'm trying to update an ID field in a table. The new record starts
with
an ID of 121888 and I'd like to update 12,010 records sequentially from
this
number. Does anyone know how to do this?
Thanks in advance.

What's in the field NOW? How would you determine which existing record
should
e 121889?
--

John W. Vinson [MVP]




 




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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 08:28 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.