Solved

Adjusting the autonumber in MS Access

Posted on 2004-09-16
3
260 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Enroll in May's Course of the Month

May’s Course of the Month is now available! Experts Exchange’s Premium Members and Team Accounts have access to a complimentary course each month as part of their membership—an extra way to increase training and boost professional development.

Question has a verified solution.

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

I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Learn how to number pages in an Access report over each group. Activate two pass printing by referencing the pages property: Add code to the Page Footers OnFormat event to capture the pages as there occur for each group. Use the pages property to …
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

738 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