DT Picker Control

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a MS Calendar Control (DTPicker) in an User Form. How do I modify the properties (value property) from a past date that somehow got in there to a variable that displays current date. I have tried Today and Now but keep getting error msgs when I try to change the "value" property. Thanks
 
I think it might be: Date() for the value property.

--
Bob Holmes
Jack_F said:
I have a MS Calendar Control (DTPicker) in an User Form. How do I modify
the properties (value property) from a past date that somehow got in there
to a variable that displays current date. I have tried Today and Now but
keep getting error msgs when I try to change the "value" property. Thanks
 
I'm not sure. The only time I've used this control was in an outlook form
and 'Date()' worked.
How about trying GetCurrentDate() or GetCurrentTime()? I don't know if they
will work either.

--
Bob Holmes MCNGP #31
Jack_F said:
Thanks for the quick reply Bob...

Unfortunately, whenever I tried putting Date() or any variation I could
think of in the Value field of the DTPicker Property box, I still get the
"Invalid Property Value" error.
 
Thanks Bob,
That doesn't seem to work either.

Bob Holmes said:
I'm not sure. The only time I've used this control was in an outlook form
and 'Date()' worked.
How about trying GetCurrentDate() or GetCurrentTime()? I don't know if they
will work either.

--
Bob Holmes MCNGP #31

think of in the Value field of the DTPicker Property box, I still get the
"Invalid Property Value" error.
 
In the UserForm_Initialize Event, where ctlCalendar is the control's
name.

Me!ctlCalendar = Date

HTH
Paul
 
the past date that you are referring to is the default date value associated with the control. I do not remember the exact property name, but you can adjust that date at design-time (only! I think). Setting the calendar control Value property (at runtime)to the current date and time is undoubtably the Date() function, or any newer function of the equivalent. The only mistakes I can see which might cause you err would be: corrupt ocx, assigning Date() to a variable of the wrong data type and then setting that variable to Value, or the previous mentioned and not including the '#' sign around the date value.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top