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 
Sequential Numbers
Carl Byerley 
      
2 years ago
In the extended Cut on Sequential Numbers you showed us how to auto assign CustomerCodes. The issue I foresee it that no 2 people enter data the same way, Is there a way that when a Code already exists, to have it automatically drop change the last character and replace it with a number. Example would be if ByeTom was already in the database the code would change it to ByeTo2. That way the database would remain consistent.
John Davy  @Reply  
         
2 years ago
Hi Carl
Have you thought about making your sequential number No Duplicates? You would also need VBA to do whatever you want if it is a duplicate.
John
Carl Byerley OP  @Reply  
      
2 years ago
I have done that, which is what inspired my question, I get a message that states, number already exists, Please change. But I would like access to automatically assign a new number. I am using "Left(CustomerName, 6)". If this happens I do not want users to just randomly change the Customer Code. I was thinking that maybe there could be some code that would just automatically change the last character to a number. Let's say the code (Chisum) received a message "Code Already exists, Please Change". In this case Access would just remove the last letter (m) and replace it with a 1 and return a new code of Chisu1. Or just add a number to the end and return a code of Chisum1. This would keep my customer code system uniform and prevent random changes. I could then display a message that said, "Your code has been modified because it was a dupliicate."
Kevin Robertson  @Reply  
           
2 years ago
Is this what you are looking for. I use some basic validation in my example but the last letter is replaced by a number in the event of duplicate codes.
Kevin Robertson  @Reply  
           
2 years ago

Carl Byerley OP  @Reply  
      
2 years ago
Thanks Kevin, I added to your tip jar. Works exactly as I need.
Kevin Robertson  @Reply  
           
2 years ago
You're welcome and thanks.

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: 5/8/2026 9:25:15 PM. PLT: 1s