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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Same DTPicker control different result?

Status
Not open for further replies.

rgao

Technical User
Feb 1, 2002
38
CA
Hi, there

Recently I have a problem with Active control-Date&Time Picker.I put two DTPickers in a form,(by default I want them display current date) but when this form is opened,one show current date, another one just show the date when I designed this form,it can not display the current date,why they have different result? I checked the property of them, everything is same,and I try to put code "me![date1].value=date" on form-open event, but got error message: this property is read only.Do you guys have any idea about it? Thanks in advance.

rgao
 
Hey,

I use the DTPicker on one of my forms as well.
When placing them on the form and checking in view-mode, I also discovered they always show the date they have been placed on the form the first time.

RightClick on the DTPicker Control / Properties / enter the following in the ControlSource :
=Date()

When the form opens, it shows the current date in the DTPICKER Control

I hope this helps.

PdtIt
 
That is wrong...sooooo wrong that it makes the date picker useless...or replaceable by a simple calculated text box showing the current date...it won't allow you to select another date...but maybe you can do it through Control Panel and change the system date... or run a batch file to do it from Access...or use the correct solution:

Private Sub Form_Load()
Me("date1") = Date
'or Me![date1].Value = Date
End Sub

works perfectly.

You can't use the Open event to set the value for this object. But Load is OK...

Good luck folks...
[pipe]
Daniel Vlas
Systems Consultant
danvlas@yahoo.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top