sspatriots
Well-known Member
- Joined
- Nov 22, 2011
- Messages
- 585
- Office Version
- 365
- Platform
- Windows
I have the Mousedown event below that clicks a calendar image to force a date from a datepicker into a textbox on Page2 of my MultiPage UserForm. The problem I'm having is when it puts it puts the date in that field, the UserForm automatically jumps back to Page1 and takes me out of Page2. The reason I have the code the way it is right now is because the way it is set up, it puts a vertical scroll bar in my "txtWeeklyStatusSummary" text box that is at the bottom of both Pages of the UserForm. It presets the scrollbar to the top of the textboxes like I want them to.
What can I do to the code below to make it such that when I use the Mousedown event my UserForm doesn't switch back to Page1. I have two of these calendar images for 2 different textboxes that get date entries that way. If someone can help me with one, I think I can fix the other.
Thanks, SS
This is at the end of my UserForm Activate code
What can I do to the code below to make it such that when I use the Mousedown event my UserForm doesn't switch back to Page1. I have two of these calendar images for 2 different textboxes that get date entries that way. If someone can help me with one, I think I can fix the other.
Thanks, SS
VBA Code:
Private Sub Image18_Mousedown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
ctrlName_SetDate = "txtCUSTPODate": FormName_SetDate = Me.Name: PopDatePickerX.Show
End Sub
VBA Code:
Private Sub MultiPage1_Change()
Dim currentPage As String
currentPage = MultiPage1.SelectedItem.Name
If currentPage = "Page1" Then
With Me.txtWeeklyStatusSummary
.SetFocus
.CurLine = 0
End With
End If
If currentPage = "Page2" Then
With Me.txtWeeklyStatusSummary2
.SetFocus
.CurLine = 0
End With
With Me.cboJobType
.SetFocus
End With
End If
End Sub
This is at the end of my UserForm Activate code
VBA Code:
Me.MultiPage1.Value = 1 'SPS, 08/10/22
Me.MultiPage1.Value = 0 'SPS, 08/10/22