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 Choosing a WeekEnding Date
BEN C 
    
13 years ago
exactly! it is the combo box for a user to pick a saturday date is what i need. lol. Can you tell me which lesson in AC2003? or AC2010?  I know you covered covered the loop somewhere in AC2003.


Reply from Richard Rost:

I haven't covered this in any single class, but it's a combination of stuff I've showed in a bunch of different classes. Manipulating a ListBox with AddItem, dates, the WEEKDAY function, etc.

Since you're a good, long-time customer, I'll walk you through it. Create a LISTBOX called MyList. Make it an "I will type in the values that I want" type of listbox (not bound to a table). Now make a command button. In the command button code, put:

    ' Clear the listbox if it has anything in it
    While MyList.ListCount > 0
        MyList.RemoveItem (0)
    Wend
    
    ' get the next year's worth of Saturdays
    For X = 1 To 365
        D = Date + X ' today's date + X
        If Weekday(D) = 7 Then ' 7 = Saturday
            MyList.AddItem D
        End If
    Next X

That should do it. Now click on the button to load up the next year's worth of Saturdays in your box. If you want this to happen automatically, then you could also run this code in the OnLoad event for your form.

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/15/2026 4:31:51 AM. PLT: 0s