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 
Help Needed
Mubeezi Micah 

14 years ago
Dear Mike,

Your request is possible but i only know how to do it the unconventional way. May be there is a better way/function out there. I share with you the principle i used the last time i did it.
1. Create a table and add a field with a default value of today (Date()).
2. This field should preferebly be located in the table where you want the counter to reset to one when a new year has begun.
3. In the before insert event of the bound form (the form that is gathering data which you want to reset to one at beginning of the year), use the dlookup function to get the maximum date value of the field mentioned in 1 above.
4. convert that value in step 3 above into a year like X = Year(MaximumDateValue)
5. Then convert today's date into a year as well. So you have Y = Year(date)
6. In your before insert event still, subtract X from Y. If the difference is not zero (0), then a new year has begun. You can then reset your counter to zero. If not, continue incrementing the counter normally.
7. In your dlookup statement (step 3 above), remember to use the nz function (and set todays date to be returned incase there are no records in the table). So if you give anybody a blank db, it will start counting from 1 automatically.

The pitfall to this is if the user changes his system date...if the date change is within the same year, then there is practically no effect.

Good luck!

MICAH

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/17/2026 2:00:23 AM. PLT: 1s