On Sat, 2 Aug 2008 05:35:23 -0700, ranswrt
wrote:
I have a userform with a multipage object on it. On page5 I have a DTPicker.
I set the value of DTPicker on the userform_initialize. If the page5 is on
when the userform is started there isn't a problem. If another page is on
then I get an error on DTPicker1.value=range("biddate"). Also if I close the
userform with another page on than page5 the value that is set from DTpicker
is 0. How is the best way to fix this and also how do I initialize the
userform so that page1 of the multipage is turned on on startup?
Thank You
I can confirm that the Date and Time Picker doesn't work on a hidden
Multipage page. You need to make the page active before you set the date.
Private Sub UserForm_Initialize()
Dim lCurrPage As Long
lCurrPage = Me.MultiPage1.Value
Me.MultiPage1.Value = 1
Me.DTPicker1.Day = 1
Me.DTPicker1.Month = 12
Me.DTPicker1.Year = 2007
Me.MultiPage1.Value = lCurrPage
End Sub
Same basic deal to read the value.
--
Dick Kusleika
Microsoft MVP-Excel
http://www.dailydoseofexcel.com