|  | Static IDs in autonumbered lookup tables |  | |
| | | Allie |  |
| Posted: Sun Sep 07, 2008 5:35 pm Post subject: Static IDs in autonumbered lookup tables |  |
Hi Folks,
I have a database which uses a bunch of lookup tables. Many of these lookup tables have auto-generated indicies, and can have records added to them by the user. I would, however, like to prefill them with a couple entries whose IDs are not in order (ie, one with ID 98 and one with ID 99).
Basically, when I export the data, I need 98 and 99 to show up for particular dropdown values. The rest I'd like to start with 1, 2, etc. If I haven't confused everyone, is there any way to do this? Thanks a bunch!
Best, Allie |
| |
| | | John Spencer |  |
| Posted: Tue Sep 09, 2008 4:38 pm Post subject: Re: Static IDs in autonumbered lookup tables |  |
You could use an insert query to add the two records.
Docmd.RunSQL "INSERT INTO Table(ID, fSubject) VALUES (98, 'XXX')" Docmd.RunSQL "INSERT INTO Table(ID, fSubject) VALUES (99, 'ZZZ')"
Of course, the next automatically genereatedautonumber will probably be 100.
John Spencer Access MVP 2002-2005, 2007-2008 The Hilltop Institute University of Maryland Baltimore County
Allie wrote:
| Quote: | Hi Folks,
I have a database which uses a bunch of lookup tables. Many of these lookup tables have auto-generated indicies, and can have records added to them by the user. I would, however, like to prefill them with a couple entries whose IDs are not in order (ie, one with ID 98 and one with ID 99).
Basically, when I export the data, I need 98 and 99 to show up for particular dropdown values. The rest I'd like to start with 1, 2, etc. If I haven't confused everyone, is there any way to do this? Thanks a bunch!
Best, Allie |
|
| |
|
|