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 
Calculating next birthday
David Cummins 
      
2 years ago
Regarding Code Vault https://599cd.com/blog/display-article.asp?ID=1272

I am not sure if or how I can apply this in a Form message box to calculate a client next birthday date?
Adam Schwanz  @Reply  
           
2 years ago
For the top section of the code if you would just do Msgbox NextBD at the end of it

For the bottom section,
Msgbox NextBD([DateField])
David Cummins OP  @Reply  
      
2 years ago
Hi Adam,

I made several attempts with different iterations, but I can't get the code to work. I think I am going down wrong road with the MsgBox. Should I build calculation in the Table instead? Or, build a query?
David Cummins OP  @Reply  
      
2 years ago

Richard Rost  @Reply  
          
2 years ago
That stuff goes in a query, not the VBA editor. 😁
Adam Schwanz  @Reply  
           
2 years ago
Copy and paste the bottom section into its own area, outside of the button. Then inside the button do the msgbox nextbd([datefield]) all by itself
Richard Rost  @Reply  
          
2 years ago
There's a VBA function under all that.
David Cummins OP  @Reply  
      
2 years ago
Thanks guys, I just realized that I am applying this to the wrong result. I am actually trying to figure out how to determine when a client turns 21. I decided for the time being for users to manually enter this information into the client form.  I am finding references for how to do this in Excel but not Access. Not sure if I can create this function in Access. Any ideas?
Adam Schwanz  @Reply  
           
2 years ago
If you want to know when someone turns 21, just do
DateAdd("y",21,DOB)

If you want to know how far away that is, use DateDiff to compare that date to the current date
David Cummins OP  @Reply  
      
2 years ago
Thanks Adam, that did the trick. I suppose I need to do a deep dive into VBA soon.
Richard Rost  @Reply  
          
2 years ago
That's what the developer lessons are for. Dive away! 😁
David Cummins OP  @Reply  
      
2 years ago
Developer is next on my list.

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/6/2026 12:10:08 PM. PLT: 1s