DTPicker set to today's date

hi

I have a DTPicker and a refresh button. if i click it the DTPicker will set to today's date. how do i do that?
aquanokAsked:
Who is Participating?
 
DabasConnect With a Mentor Commented:
Maybe DTPicker1.Value = Now
0
 
Ryan ChongCommented:
Try set the DTPicker's Value Property.

Example:

Private Sub cmdRefresh_Click()
    DTPicker1.Value = Date
End Sub

cheers
0
 
Ryan ChongCommented:
Just in case you want to display the date in the Format you want, you can always do this:

1. Right Click the DTPicker Control, click its Property
2. In the General Tab, under Format drop-down, select 3 - dtpCustome
3. Finally at the bottom CustomFormat textfield, enter the date format you want, example: dd/MM/yyyy

cheers
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.