PDA

View Full Version : [SOLVED] Mutlipage UserForm Referencing



TriMacro
11-19-2004, 12:21 AM
Another novice question for you.

I have a multipage userform in a worksheet, how do I reference that same userform from different places to different pages dependent upon where the reference came from?

Jacob Hilderbrand
11-19-2004, 12:32 AM
Do you want to know how to change the mutipage page that is active?


UserForm1.MultiPage1.Value = 1

Multipage values start at 0 for the first page, 1 for the second, and so on.

TriMacro
11-19-2004, 01:34 AM
That works, thank you. Out of curiosity, why does the userform have to be opened and closed once for it to work properly? For instance, if the userform was last opened in page 3 then no matter what page it's supposed to reference next, it pulls up page 3. But, if I close the userform again and re-open it using the new reference again, it works fine. Is there a better way to close the userform than UserForm1.hide?

Jacob Hilderbrand
11-19-2004, 02:16 AM
UserForm1.Hide
Hides the User Form. It is still open and stored in memory, it is just not visible. To close the User Form use this:

Unload Me
'Me refers to the User Form where this code resides.
Or

Unload UserForm1

TriMacro
11-19-2004, 09:03 AM
I'm sorry, I should have mentioned that I tried that and it didn't work. Currently I was simply using .hide because it left the data in the form until the clear function was used to unload the form from memory.

Zack Barresse
11-19-2004, 10:24 AM
Unload InfoEntry

And I'd use something like this, assigned to different buttons for whatever page you wanted open ...


Sub Open_EntryInfo()
Load InfoEntry
InfoEntry.MultiPage1.Value = 0
InfoEntry.Show
End Sub

TriMacro
11-20-2004, 02:09 AM
It's working perfectly now - thanks! I worked on it earlier today and that is almost exactly the code I came up with and achieved the desired result.