Solved

Adjusting the autonumber in MS Access

Posted on 2004-09-16
3
232 Views
Last Modified: 2006-11-17
Hi,

I am working on a MS Access database, the current value is 8870, the number range 9000 is used for internal numbers so what I want to do is as I reach the 8999 mark is to jump  6000 and continue the autonumber from 15000 onwards, what would be the best way to do this, and can I do it without insert blank records?

Many thanks
peter
0
Comment
Question by:trojan_uk
  • 2
3 Comments
 
LVL 9

Accepted Solution

by:
solution46 earned 125 total points
ID: 12075199
Yep, if you explicitly run an insert, you can override the autonumber.

Use...

DoCmd.RunSQL "INSERT INTO my_table (my_id, my_fields) VALUES (14999, blank_values)"

Then delete the inserted record and the next one you enter will get id 15000.

s46.
0
 

Author Comment

by:trojan_uk
ID: 12075646
Many thanks s46

Peter
0
 
LVL 9

Expert Comment

by:solution46
ID: 12077191
no probs - glad to help.

s46.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In the article entitled Working with Objects – Part 1 (http://www.experts-exchange.com/Microsoft/Development/MS_Access/A_4942-Working-with-Objects-Part-1.html), you learned the basics of working with objects, properties, methods, and events. In Work…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now