Hi, I have a little problem with hiding a Userform.
So, I have a Userfrom called "Userform2" and there I have a textbox. When I click the textbox appear another Userform,called "Calendar1", which is a Date Picker. What I want: when I choose the date, the Userform Calendar1 needs to hide,or unload,something like that. But I get error. If somebody can help me?
Thanks
So, I have a Userfrom called "Userform2" and there I have a textbox. When I click the textbox appear another Userform,called "Calendar1", which is a Date Picker. What I want: when I choose the date, the Userform Calendar1 needs to hide,or unload,something like that. But I get error. If somebody can help me?
Thanks
Code:
Private Sub Calendar1_Click()
UserForm1.JoinDateTxt.Value = Format(Calendar1.Value, "dd/mmm/yy")
Calendar1.Unload
End Sub
Code:
Private Sub JoinDateTxt_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Calendar1.Show
If Len(JoinDateTxt.Text) > 0 Then
JoinDateNum = DatePart("d", JoinDateTxt) - 1
End If
End Sub