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 
Access Increment Custom Counter
Daniel 

15 years ago
I am a beginner and have created a database and one of the functions on my user input form calls for a sequential number to identify the next Job Number [JodID]. The sequential number restart each day. I get the Date to populate the subform with a Date() Query that properly returns only todays jobs. I have added "Me.JobID = DMax("[JobID]", "731DailyReportT", "[Date] = #" & Me.Date & "#") + 1" to the Forms onload event. My exact problem is that unless I manually put a beginning number like 1 in my table, my sequence number is always blank. Any halp would be greatly appreciated since I have been trying to fix this for 3 days.


Reply from Richard Rost:

First, I would put this in the BeforeInsert event, not the OnLoad event. This way it only has to run when the use inserts a new record. I would DMAX the current ID, and then if that result is NULL set it to 1. If not, set it to the next number. You'll need a little If/Then statement. Aside from that, your logic is sound.

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/31/2026 5:32:11 PM. PLT: 1s