Solved

Adjusting the autonumber in MS Access

Posted on 2004-09-16
3
222 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

In a multiple monitor setup, if you don't want to use AutoCenter to position your popup forms, you have a problem: where will they appear?  Sometimes you may have an additional problem: where the devil did they go?  If you last had a popup form open…
Overview: This article:       (a) explains one principle method to cross-reference invoice items in Quickbooks®       (b) explores the reasons one might need to cross-reference invoice items       (c) provides a sample process for creating a M…
Familiarize people with the process of utilizing SQL Server stored procedures from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Micr…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

758 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

22 Experts available now in Live!

Get 1:1 Help Now