Access 2007-2019
Access 2000-2003
Access Seminars
TechHelp Support
Tips & Tricks
Access Forum
Course Index
Topic Glossary
Insider Circle
 
Home   Courses   Seminars   Templates   Help   TechHelp   Forums   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > Sequential Number < Deleted AutoNumber | Customer Codes >
 
Custom Sequential Number
By Richard Rost   Richard Rost on Twitter Richard Rost on LinkedIn Email Richard Rost   13 months ago

Create Sequential Numbering to Replace OrderID AutoNumbers


 S  M  L  XL  FS  Join Now

In this tutorial you will learn how to create your own custom order number that you can start at whatever value you want and have Access automatically increment the values so you have nice sequential order numbers that have no gaps. 

Timothy asks, "I’m using an AutoNumber for OrderID in my table, like you taught me, but my accountant wants me to have sequential numbers for reporting purposes. What should I do?"

Members

I'll show you how to replace NULL with Order Number values for existing records. We'll talk about problems with multi-user databases and see how to save that new number to the table immediately to avoid conflicts, and we'll learn how to make a Custom Order Number sequence for each Customer, so for example XYZ Company's invoices will be numbered: XYZ-001, XYZ-002, XYZ-003, etc. And of course we'll assign Customer Codes that are unique and alphanumeric.

Silver Members and up get access to an Extended Cut of this video. Gold Members can download the database template from class plus get access to the Code Vault. If you signed up on YouTube you have to contact me so I can set up your account here on my web site. If you're not a member, Join Today!

Addendum

If you start off with a table that already has data in it, the code in the video works just fine. However, if you start with an empty table, you'll get an error. The solution:

In the BeforeInsert event, wrap the DMax function inside Nz:

OrderNumber = Nz(DMax("OrderNumber", "OrderT"),0) + 1

That will now set OrderNumber equal to ZERO if there aren't any records.

Links

Learn More

FREE Access Beginner Level 1
Access Level 2 for $1.00

Free Templates

TechHelp Free Templates
Blank Template
Contact Management
Order Entry & Invoicing
More Access Templates

Resources

Mailing List - Get Emails When New Videos Released!
Consulting - Need Help with Your Database?

Questions?

Please feel free to post your questions or comments below or submit them via the TechHelp page.

 

Counter with No Records Upload Images   Link 
Richard Rost 
53 days ago
User Derek Wright on my YouTube channel brought up a great question:

Thank for this it has really helped me with an equipment inspection database,  one question though is if I start with zero records it does not work but if I already have say a single dummy record in with the number 1 it then works fine. Is there a way around this anomaly? Read More...
Add a Reply

Start a NEW Conversation
 
Only students may post right now. Click here for more information on how you can set up an account. If you are a student, please LOG ON first.
 
Subscribe
 

You may want to read these articles from the 599CD News:

9/26/2021Sliders
9/25/2021Convert Currency
9/25/2021Get Data from Web API
9/25/2021Access Developer 32 Lessons
9/25/2021Access Developer 33
9/25/2021Access Developer 33 Lessons
9/25/2021Access Developer 33
9/24/2021Export HTML
9/22/2021Access DevNet Testimonials
9/20/2021Letter Writer
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Account Login
Online Theater
Downloads
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
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
Email Richard
Mailing Address
Phone Number
Fax Number
Course Survey
Blog RSS Feed    Twitter

YouTube Channel    LinkedIn
Keywords: TechHelp Access counter Create Your Own Custom Sequential Automatically Incrementing Number with DMAX counter consecutive  PermaLink