ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Multipage error (https://www.excelbanter.com/excel-programming/415035-multipage-error.html)

ranswrt

Multipage error
 
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

Dick Kusleika[_4_]

Multipage error
 
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


All times are GMT +1. The time now is 02:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com