M
Mark
I have 2 date/time pickers that are on the 3 page of a multipage on a userform.
For some reason, when you switch between pages, the 1st picker moves from
it's locations (left 198, top 66) to the far upper left corner of the form.
I have tried adding code to move it back whenever the multipage changes,
however, it doesn't work (despite the fact that the event triggers other
aspects of the code). Any ideas as to why its moving on me?
Private Sub MultiPage1_Change()
' Page 3: Set the date picker default value to the first of the current year
If MultiPage1.Value = 2 Then
With UserForm1
.DTPicker1.Value = DateSerial(Year(Date), 1, 1)
.DTPicker1.Left = 198
.DTPicker1.Top = 66
.DTPicker2.Value = DateSerial(Year(Date), Month(Date), Day(Date))
MsgBox .DTPicker1.Left
End With
End If
End Sub
For some reason, when you switch between pages, the 1st picker moves from
it's locations (left 198, top 66) to the far upper left corner of the form.
I have tried adding code to move it back whenever the multipage changes,
however, it doesn't work (despite the fact that the event triggers other
aspects of the code). Any ideas as to why its moving on me?
Private Sub MultiPage1_Change()
' Page 3: Set the date picker default value to the first of the current year
If MultiPage1.Value = 2 Then
With UserForm1
.DTPicker1.Value = DateSerial(Year(Date), 1, 1)
.DTPicker1.Left = 198
.DTPicker1.Top = 66
.DTPicker2.Value = DateSerial(Year(Date), Month(Date), Day(Date))
MsgBox .DTPicker1.Left
End With
End If
End Sub