Link to home
Start Free TrialLog in
Avatar of aquanok
aquanok

asked on

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?
Avatar of Ryan Chong
Ryan Chong
Flag of Singapore image

Try set the DTPicker's Value Property.

Example:

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

cheers
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
ASKER CERTIFIED SOLUTION
Avatar of Dabas
Dabas
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial