Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DTPicker.Value Read-Only? 1

Status
Not open for further replies.

dapotter

Programmer
Oct 9, 2004
32
US
I am trying to set the value of a DTPicker control to a specific date, such as today's date. According to the object browser, the Value property "Returns/sets the current date." When I try to assign to the value in my VBA code, I get a message saying the property is read-only.

I can set the value of the property on the Others tab when the form is in design mode, but only to a static date. Is there a way to force the control to today's date (or some other programatically determined date) at runtime?

Thanks,
Don
 
Are you trying something like this?
Code:
Private Sub Form_Load()
Me.DTPicker1.Value = DATE
End Sub

________________________________________________________________________
Zameer Abdulla
Visit Me
Children are poor men's riches.
 
Yes. That is almost exactly what I was doing. The only difference is I was using the Form.Open event. When I tried it again using the Form.Load event, the current date loaded just fine. Do you know why the Form.Open event doesn't work?

Thanks,
Don
 
See "Load Event" in the help

________________________________________________________________________
Zameer Abdulla
Visit Me
Children are poor men's riches.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top