views:

53

answers:

2

So I have a drop down box in my vb6 form, I was wondering if there was an easy way to have it display the dates for the week begining for the next 4 weeks. e.g. if it was running now it would have

19/4/2009 26/4/2009 3/5/2009 10/5/2009

A: 

Simply calculate the first day of the week, and then add 7 days.

Paulo Santos
+3  A: 

Here is a simple method that will do what you want.

   Dim i As Integer
   Dim myDate As Date

   myDate = DateAdd("d", -Weekday(Now), Now)

   For i = 1 To 4
      Combo1.AddItem FormatDateTime(DateAdd("d", i * 7, myDate), vbShortDate)
   Next i
Beaner