Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to Access Forum    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Renumber AutoNumbers
Charles Zigler 
   
5 years ago
So, I have autonumber setup and I have a form that you can fill out and it saves to the table with the autonumber, but if I start filling out the form the autonumber is generated and even if I cancel and I start to fill out a new one it goes on to the next number. I have my cancel set to Me.undo and docmd.close. So during my testing for example I filled out the form and saved it, worked perfectly, generator number 1, but then I wanted to test cancel which seemed like it worked until I went to fill out the form and it generated number 3 instead of 2. So, on my table I have 1,3, and then 10 because I just kept clicking cancel trying some different things and I thought maybe compress and repair would change the number, but sadly no it just stay 1,3 and 10 even though it should be 1,2, and 3
Alex Hedley  @Reply  
           
5 years ago
You'd have to delete record 10, then compact to get it to reset BUT AutoNumbers aren't for you.
AutoNumbers Good or Bad?
Scott Axton  @Reply  
        
5 years ago
Asked and answered - many times.  Please take a look through the posts and videos.

Short answer is that Access uses the AutoNumber to maintain uniqueness of records.  It is NOT for you to use.  Not something to rely on in any other way except to relate records together. Access is doing exactly what it is intended to do.  Once used it never reuses that number even if you cancel.

There are videos on here that also give you a way to give custom numbering for your customers if you need a solution for that.
I'm not at a place to look them up right now but if you would like some pointers just holler and I'll dig them up for you.
Adam Schwanz  @Reply  
           
5 years ago
There has been a lot of these lately on autonumbers. Long story short, you should not be using autonumbers for anything, they are only for access to keep track of records. Whatever number they are at should not matter to you at all.

If you need to have an "autonumber" that you actually use for invoice numbers or something. See this Custom Sequential Number
Alex Hedley  @Reply  
           
5 years ago
Charles Zigler OP  @Reply  
   
5 years ago
Wow! Thanks everyone really appreciate the help. Apologies for failing to locate that myself. I now have a new problem. So, I'm doing all this to organize maintenance. My maintenance personnel can now open up the database, click a button and it pops up a form to fill out for what PM they performed and when they performed it and that goes into a running log. I also have a table that lists every machine and every pm on that machine and how often it needs to be done such as every 30 days. I need to make some kind of data table that will show me what PM's are overdue by comparing the running log of PM's to how often they should be done. So I am trying to find a way to compare the column named "DateCompleted" from "tblPMlog" to the column of "frequency" from "tblPmTaks" and today's date. I have been messing around with queries but I'm not sure it can do what I'm looking for maybe it can and I just don't understand the full potential. Any suggestions on how to go about doing this?
Adam Schwanz  @Reply  
           
5 years ago
Make a query expression that does Date() - DateCompleted , say we call it DaysSinceComplete

Then Make another expression like IIF(DaysSinceComplete>Frequency,"OverDue","Current")   IIF Function

Charles Zigler OP  @Reply  
   
5 years ago
Worked brilliantly. I think I only have one last question. Right now, I have a table which has the machine, then PM to be done on it. So, the machine name repeats for every PM that is for that machine. I want a combo box to pull the machine list with no duplicates, right now I have a separate table that lists the machines so it doesn't pull duplicates, but then I want the PM combo box to only display PM's for the selected machine. Right now I just have it displaying every possible PM. Is this possible? For the row source of Machine combo box: SELECT [tblMachineName].[Machine Name] FROM tblMachineName; then PM combo: SELECT [tblTask].[Maint Point] FROM tblTask; I tried SELECT [tblTask].[Machine] FROM tblTask; for the Machine combo box but it just repeats the machine name over and over. I watched the relationalcombo video and combovaluelist video but didn't seem to answer my question.
Alex Hedley  @Reply  
           
5 years ago
Try adding a SELECT DISTINCT ...
Richard Rost  @Reply  
           
5 years ago
Aggregate Query

This thread is now CLOSED. If you wish to comment, start a NEW discussion in Access Forum.
 

Next Unseen

 
New Feature: Comment Live View
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 6/16/2026 2:32:22 PM. PLT: 1s