DixiePiper
New Member
- Joined
- Oct 19, 2015
- Messages
- 41
- Office Version
- 365
- Platform
- Windows
I have a 4 page MultiPage control in a UserForm. On the 2nd page, I have a group of 2 option buttons followed by a series of TextBoxes in which I need to enter dates. To manage the TextBoxes, I have a separate UserForm, named CalendarForm, that serves as a date picker. After as much experimentation as I could manage, the only way I found to launch the CalendarForm was to use "Private Sub TextBox1_Enter()". That works fine for me. The issue I'm now having is with navigation. When entering the page, the CalendarForm launches. I need the CalendarForm restricted to interacting with the TextBox.
I'm using Excel 2013 in a Windows 10 environment. Here's the code snippets:
To launch the CalendarForm
The above repeats for three additional TextBoxes. Disabling the startBase event fixes the problem so I know it's got something to do with this TextBox.
I have navigation buttons located in the UserForm for "Cancel", "Back", "Next", and "Finish". Shown is the code for the buttonNext; the code is similar for buttonBack
"Update Controls" refers to a separate process that enables/disables the navigation buttons based on the current page; it's irrelevant to this issue. The SetFocus works just fine. When entering Page2, either via the "Next" or "Back" buttons, the CalendarForm launches and I have to close it to continue. What am I missing?
Thank you in advance for any assistance.
I'm using Excel 2013 in a Windows 10 environment. Here's the code snippets:
To launch the CalendarForm
Code:
Private Sub startBase_Enter()
Dim dateVariable As Date
dateVariable = CalendarForm.GetDate
If dateVariable <> 0 Then startBase = dateVariable
End Sub
I have navigation buttons located in the UserForm for "Cancel", "Back", "Next", and "Finish". Shown is the code for the buttonNext; the code is similar for buttonBack
Code:
Private Sub NextButton_Click()
MultiPage1.value = MultiPage1.value + 1
Select Case MultiPage1.value
Case 1
optionConcurrent.SetFocus
Case 2
btnSelectAll.SetFocus
Case 3
CommandButton12.SetFocus
End Select
UpdateControls
End Sub
Thank you in advance for any assistance.