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 
How to format ascending number
Asteropi Papadopoulou 
   
2 years ago
So I need to format a cell to create lot numbers.
I want it to be the SupplyID-Date-Ascending number

I have figured how to get the first two parts, but the last part needs to be an ascending number for every different ingredient, so I can't use the lot autonumber for instance.
For example, I have 2 ingredients

My lots should be like this:
Ingredient 1: 001(supplyID)-241012(Date)-01, 001-241012-02
Ingredient 2: 002-241012-01, 002-241012-02 etc


For the first 2 parts the code I wrote is like this:

Code:
If IsNull(Me.LotNumber) Then
    Me.LotNumber = Format(Me.SupplyID, "000") & Format(Date, "yymmdd") & Format (I need this part)
End If

How can I do that so that it will recognise it's a different ingredient every time and continue from where it left off?
Sami Shamma  @Reply  
             
2 years ago
Hi Asteropi,

Is your ascending number the same for all lots, or is it different for different suppliers?

1) In the first case, create a numeric field on a DefaultT type table and use DMax to get the last number there and then increment the number.

2) In the second case, store that number in the Supplier table and remember to increment it.
Asteropi Papadopoulou OP  @Reply  
   
2 years ago
it's different for different supplies, not suppliers
Kevin Robertson  @Reply  
          
2 years ago
Please tell us your table structure so we can possible build a sample to test. Otherwise, we are just guessing.
Screenshots may also help.

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 8:32:25 PM. PLT: 0s