Static IDs in autonumbered lookup tables

A

Allie

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
 
J

John Spencer

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
 
Top