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 
Creating a Report
Nathan Maturine 
   
4 years ago
In generating an invoice, the current application uses a DMAX function to get the last record in the table. I would like to find a way to determine the ID number in the table where the record was just written. for some reason another person can create an invoice after the person one, so person 1 record would not be the last entry in the table.
Adam Schwanz  @Reply  
           
4 years ago
So are you saying you go in and the invoice is defaulted to be the dmax, say invoice 100, then someone else goes in and gets invoice 100 at the same time and you have duplicates?

If so, I would instead assign the invoice number with the dmax on a "save" button at the end of creating the invoice. Then you know you're always getting the most current record and if other people are saving invoices at the same time it will be the most current one. Otherwise you need to instantly "save" that record when you open the form to lock that invoice number into the table, which if you end up not needing to do the invoice or something will result in a blank record with an invoice number if you don't delete it.
Nathan Maturine OP  @Reply  
   
4 years ago
I have a lastnums table that i use for receipt and invoice numbers. Once data is captured on the form, the creation of the invoice is done in VBA and written to my tbl_GroupBilling table. I have a "Create Invoice" button on the form that triggers that code, which does some checks and validation and some user message acknowledgments before an invoice number is assigned. After the data is written to the table, the report (invoice) is triggered.
Adam Schwanz  @Reply  
           
4 years ago
So you're going through these checks, then it automatically assigns an invoice, then are you saving the record at this point or is the record still dirty?

If the record is created and then saved at the point of assigning, it should update to the table instantly and the next person to push the button would see that it exists and grab the following number.

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:26:30 PM. PLT: 1s