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 
Automatic File Numbers
Jennifer Cruikshank 
   
4 years ago
Is there a way to create an automatic file number aside from the Primary Key? We create file numbers in the following format: 2-digit year, 2-digit month and then 3 digits in sequential order, ie: 2210-123. This number format tells the year and month and what # transaction for the year it is. The number will start over the next year with 2301-001. January 2023, transaction #1. Currently I create it by hand in a table. There are no duplicate file numbers.
Kevin Robertson  @Reply  
           
4 years ago
John Davy  @Reply  
         
4 years ago
Hi Jennifre
Take a look at Rick's Sequential Numbers and ISO Date Format
HTH
Juan C Rivera  @Reply  
            
4 years ago
I made one that did a similar type of number.  did the last 2 digits of the year (22) with the Julian date (365) and sequence (000-999) for Wor Orders.  but its all in VBA.  Scott helped me with this and it works good for what I need do you wish for me to send to you send me an email will be happy to share.
Sandra Truax  @Reply  
         
4 years ago
This is one Richard did for me that sounds like it does EXACTALLY what you want.


Sequential Annual Coding video.
Juan C Rivera  @Reply  
            
4 years ago
Oh wow, I forgot about this one.. you are right that's great!  You go Sandra :)
Jennifer Cruikshank OP  @Reply  
   
4 years ago
So I am still very much a beginner. I created a very basic database many years ago just to keep track of file#s. I have watched the video suggestions everyone recommended above but I don't see anything to where I can add the current month and then have it change when the month new month begins.  I don't mind adjusting the file number to a 4 digit year as suggested but I really would like to keep the 2 digit month in there and then sequentially there after, until the new year starts.  Any suggestions or another direction I can be pointed to?
Adam Schwanz  @Reply  
           
4 years ago
If you use the month function, it will automatically change depending on the date.

Month(Date) would always be the current month, with no intervention from you.
That Sequential Annual Coding video Sandra linked should be what you are looking for. But you could use month instead of year

So Month(Date) & Year(Date) & "Hi" would on today give you a value of 112022Hi on December 1st it would automatically become 122022Hi. I don't recall what was used in the video but I assume it was DMAX. So you could do

YourFieldOrVariable=Month(Date) & Year(Date) & NZ(DMAX("FileNumber","Table",Month(DateField)=" & Month(Date) & " and Year(DateField)=" & Year(Date),0)+1

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 4:32:36 PM. PLT: 1s