If you'd like to only have the calendar appear when you need to pick a date, you can use this routine.
First, select the calendar and goto Properties--Format and set Visible = No
Then place this code in the form's code module:
- Private Sub Form_Load()
-
YourCalendarName = Date
-
End Sub
-
Private Sub YourCalendarName_Click()
-
YourTextBoxName = YourCalendarName
-
YourTextBoxName.SetFocus
-
YourCalendarName.Visible = False
-
End Sub
-
Private Sub YourTextBoxName_DblClick(Cancel As Integer)
-
YourCalendarName.Visible = True
-
End Sub
-
Now, when your user DoubleClicks on the textbox where the date will go, the calendar will appear. The date is picked, and the calendar disappears!