Ark68
Well-known Member
- Joined
- Mar 23, 2004
- Messages
- 4,564
- Office Version
- 365
- 2016
- Platform
- Windows
I have a userform in which I have a multipage control with three pages. Of the three pages, the first page (value=0) is considered my "default".
The user can step through the pages in any order and everything behaves as expected. The page changes are controlled with the multipage_change event
When the user selects either the second or third tab (page), a second userform (uf9c_idate) opens allowing the user to enter some additional information. The user may opt out of this by pressing a commandbutton control (cancel). With pressing this button, the userform is closed, and the multipage control's value is set to 0 to return the multipage to the default page.
What ends up happening is the tab changes, but the default page's contents do not change appropriately. The contents remain that of the controls from the page the user had selected previously.
I had originally posted this here , where I was advised that this behavior may be due to a bug. But I'm unsure if this is the "bug" that is creating my problem. The reference that was shared with me, as well as similar google searches, reveal the problem may be caused from user input on the other pages. In my case, I am getting incorrect behavior from code being run from a control on a separate userform, rather than switching pages from within the multipage control.
I'm wondering if anyone might be so kind as to review my code to see if I am encountering a similar behavior as suggested, or I have faulty code? If this is a situation that is not recoverable by means of how I hope, can anyone suggest an alternative method? Ideally, I really need the user to be returned to the contents of the default page of the multipage control.
The user can step through the pages in any order and everything behaves as expected. The page changes are controlled with the multipage_change event
When the user selects either the second or third tab (page), a second userform (uf9c_idate) opens allowing the user to enter some additional information. The user may opt out of this by pressing a commandbutton control (cancel). With pressing this button, the userform is closed, and the multipage control's value is set to 0 to return the multipage to the default page.
Code:
Private Sub uf9c_cancel_Click()
'Debug.Print uf9_poststaff.MultiPage1.Value
'Debug.Print mbEvents
'mbEvents = False
uf9_poststaff.MultiPage1.Value = 0
Unload uf9c_idate
End Sub
What ends up happening is the tab changes, but the default page's contents do not change appropriately. The contents remain that of the controls from the page the user had selected previously.
I had originally posted this here , where I was advised that this behavior may be due to a bug. But I'm unsure if this is the "bug" that is creating my problem. The reference that was shared with me, as well as similar google searches, reveal the problem may be caused from user input on the other pages. In my case, I am getting incorrect behavior from code being run from a control on a separate userform, rather than switching pages from within the multipage control.
I'm wondering if anyone might be so kind as to review my code to see if I am encountering a similar behavior as suggested, or I have faulty code? If this is a situation that is not recoverable by means of how I hope, can anyone suggest an alternative method? Ideally, I really need the user to be returned to the contents of the default page of the multipage control.