Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Date Based Combo Box & Multi Records 1

Status
Not open for further replies.
May 5, 2002
79
US
All Seasons Greetings,

Fairly new to Access. I need to populate a combo box with a selection of dates (every Saturday from 1/1/2004). Is there a function or query I can build to do this? The second question is I would then like to populate 7 records in a subform with the dates of the week (sunday thru Saturday). I believe that can be done via referring to the parent form Parent.comboxname. How do I only show 7 records in the subform?

Any help or guidance would be very appreciated.

 
There may be a couple of ways to do this. You can dynamically populate a combo box by referring to the "rowsource" property, in a loop, something like this:

Dim saturday As Date
For saturday = #1/3/2004# To #12/31/2004# Step 7
Combo0.RowSource = Combo0.RowSource & "," & saturday
Next


This will populate your combo with each of the Saturdays in 2004.


If you think about it, you can probably figure out how to get your seven day records in the subform, from this example....if not, let us know.

Jim


Don't be sexist - Broads hate that!Another free Access forum:
More Access help stuff at
 
Thanks. Code worked great once I figured out that the source type had to be set to value list.

Happy Holidays.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top