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 
Calendar Function Repeat Event
Jan 

16 years ago
Platform is Access 2003(XP), I have used MSAccess since 1995 (just so you know my level to understand your instructions.
I have a reservation system that uses a subform to assign the facilities needed for an event.  Some clients use the same facility for the entire year for the same day every month - ie second Tuesday every month.  I would like the code to fillin the dates for the rest of the year (or an stop date I specify) and repeat the facility code for every line in the subform for that eventID.  Have you created or seen VB code that addresses this and can be used in MSAccess?


Answer from Richard Rost:

You could do this with a little bit of VBA code. Just make a button in the footer of your subform that would do something like this: (THIS IS NOT TESTED, but is to just give you an idea of how to do it)

StartD = InputBox ("StartDate")
EndD = InputBox ("EndDate")

X = StartD
While X < EndD
  Docmd.GotoControl "DateField"
  Docmd.GotoRecord acNewRec
  DateField = X
  X = X + 7
Wend

This will basically form a loop that will run from your start date to your end date, going to a new record, and then setting the date. It will then move ahead a week (+7).

Again, I didn't test this, it's just off the top of my head… but it should get you started. I'm sure you'll have to adjust the field names and syntax a little bit.

Hope this helps.

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/22/2026 9:24:42 AM. PLT: 1s