Combo box with next 5 sundays

109bow

Registered User.
Local time
Today, 00:04
Joined
Oct 24, 2007
Messages
141
Hi all,
This is a follow up from a post I made some time ago. On a form I have a combo box that gives me the option of selecting from one of the next 5 Sundays;

Private Sub Form_Open(Cancel As Integer)
Dim I As Integer
cboSundays.RowSource = ""
For I = 1 To 5
cboSundays.RowSource = cboSundays.RowSource & date - Weekday(date) + 1 + (I * 7) & ";"
Next I
End Sub

This works fine, but in practice it would be really useful if the combo box shoed the last sunday and the next 4 sundays, based on the current date.
Don't know if this is possible, but fingers crossed.
 
So the current code goes from 1 week to 5 weeks out? And you want the code to go from 0 weeks to 4 weeks out? Is that right?

Is that enough of a hint? :)

Mark
 
Thanks Mark, so obvious when its in front of me.;)
 

Users who are viewing this thread

Back
Top Bottom