Solved

Adjusting the autonumber in MS Access

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone 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

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Familiarize people with the process of utilizing SQL Server functions 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 Microsoft Ac…
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…

860 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