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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|