Google
 
Webnews.only-4-geeks.com
Interesting places
news.only-4-geeks.com Forum Index » Access

Static IDs in autonumbered lookup tables

 
Jump to:  
 
Allie
PostPosted: 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
PostPosted: 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
 

Page 1 of 1 .:.

Google
 
Webnews.only-4-geeks.com

Windows Update | C++ | C | PHP | JavaScript | Photoshop | Programming | Windows 2000 | Python | Windows XP | Object | Flash | Flash - ActionScript | Paint Shop Pro | Excel | PowerPoint | Access | Word | Windows 98 | Internet Explorer 6.0 | CorelDraw12 | Java | XML | asm x86 | Linux Mandrake | Linux RedHat | Outlook |  | news from newsgroups |_ | s

Web Templates

Awesome Website Templates ©

homeopatia vichy apartamenty Warszawa Pozycjonowanie w google projekty domów Pendrive