Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Adjusting the autonumber in MS Access

Posted on 2004-09-16
3
Medium Priority
?
280 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 500 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
If you’re using QODBC to update QuickBooks data from Microsoft® Access but Access is not showing the updated data, you could have set up QODBC incorrectly.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…
Suggested Courses

877 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