date / time picker error

M

Mark

I am using 2 date / time pickers in a userform.

This userform has a multipage with 4 pages (the date / time pickers are on
page 3).

Currently, I have code specifying what value the date/time pickers should go
to by default (the first is set to the first day of the current year and the
second is set to today).

With UserForm1
.DTPicker1.Value = DateSerial(Year(Date), 1, 1)
.DTPicker2.Value = DateSerial(Year(Date), Month(Date), Day(Date))
End With

The code to set the default value is part of the userform_initialize event.
However, when the event runs, I get an error stating "An error occured in a
call of the windows date and time picker control." So, the two controls end
up having values of 1/1/1900.

So, to see what the issue was, I put a button on the userform to update the
date / time picker values using the same exact code as I used in the event
initialize event. This works! However, I can't have users clicking buttons
to update what should be default values.

Any ideas? Is there a multipage select event? Any other way I can have
them automatically update without having the user do the work?
 

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

Top