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 » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

How to append running number



 
 
Thread Tools Display Modes
  #1  
Old December 4th, 2009, 09:36 PM posted to microsoft.public.access.queries
Boon
external usenet poster
 
Posts: 115
Default How to append running number

Hello,

I have a table A. the first field in table A is called ID. the data type is
integer.

I have created a query. In this query I would like to be able to append data
in to table A, with one specific thing. I would like to be able to append
the row number to column ID in table A.

For intance, if table A is empty, and I apeend 10 records to table A, I want
column ID to have number 1 through 10 when appending.

if table A has 20 records. and I append 10 records to table A, I want column
ID to have number 21 through 30 for my newly appending records.



thanks!
Boon


  #2  
Old December 5th, 2009, 05:24 PM posted to microsoft.public.access.queries
Lynn Trapp[_4_]
external usenet poster
 
Posts: 9
Default How to append running number

Does this ID number have to be sequential, without any gaps? If not, you
should consider using an AutoNumber field for that field. If yes, you will
probably need to write a vba function to accomplish what you want.

--
Lynn Trapp
Trainer/Application Developer


"Boon" wrote in message
...
Hello,

I have a table A. the first field in table A is called ID. the data type
is integer.

I have created a query. In this query I would like to be able to append
data in to table A, with one specific thing. I would like to be able to
append the row number to column ID in table A.

For intance, if table A is empty, and I apeend 10 records to table A, I
want column ID to have number 1 through 10 when appending.

if table A has 20 records. and I append 10 records to table A, I want
column ID to have number 21 through 30 for my newly appending records.



thanks!
Boon


  #3  
Old December 5th, 2009, 07:13 PM posted to microsoft.public.access.queries
KenSheridan via AccessMonster.com
external usenet poster
 
Posts: 1,610
Default How to append running number

Boon:

If there really is a good reason for having an unbroken sequence you'll need
to compute them as an autonumber only guarantees unique values, not
necessarily sequential ones, which in turn means data entry must be via a
form (which it should be in any case). For two approaches, both of which
prevent the conflicts which are possible in a multi-user environment, see the
following links. The second, slightly more complex, solution also allows the
next number to be used in the sequence to be 'seeded':

http://www.rogersaccesslibrary.com/f...19 89c53d7ffb


http://community.netscape.com/n/pfx/...g=ws-msdevapps


Ken Sheridan
Stafford, England

Boon wrote:
Hello,

I have a table A. the first field in table A is called ID. the data type is
integer.

I have created a query. In this query I would like to be able to append data
in to table A, with one specific thing. I would like to be able to append
the row number to column ID in table A.

For intance, if table A is empty, and I apeend 10 records to table A, I want
column ID to have number 1 through 10 when appending.

if table A has 20 records. and I append 10 records to table A, I want column
ID to have number 21 through 30 for my newly appending records.

thanks!
Boon


--
Message posted via http://www.accessmonster.com

 




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 02:27 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.