tags:

views:

75

answers:

1

Using VB 6

Am using DTPicker Control, In that I want to display weekly like

01/07/2009, 08/07/2009, 15/07/2009 so on…,

If I am selecting a date after 01/07/2009, it should Display 08/07/2009, if I am selecting a date after 08/07/2009, it should display 15/07/2009.
If am selecting a date before 01/07/2009, It should display 25/06/2009, if I am selecting a date before 08/07/2009, it should display 01/07/2009

Like that I want to display a date.

Need VB 6 Code Help.

A: 

Try this (DTPicker1 should be replaced by the name of your DTPicker control):

Private Sub DTPicker1_CloseUp()
    DTPicker1.Value = DateAdd("d", 7 - DTPicker1.DayOfWeek, DTPicker1.Value)
End Sub
awe