Can anyone help me with this code? Im implementing a calendar into a Access form, and the calendar does not hide nor does it activate when clicked on. It just stays there on the right side of the field on the form. Initial Contact Date is the date, we built an Event for Calendar 5 to pop up so the user can select the date and it will fill the field. Anyone? Private Sub Initial_Contact_Date_Click() Initial_Contact_Date = Calendar5.Value Initial_Contact_Date.SetFocus Calendar5.Visible = False End Sub Private Sub Initial_Contact_Date_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single) Calendar5.Visible = True Calendar5.SetFocus End Sub
Defined in the old date text box. We put a compbo box in there so it could become clickable for the calendar to display for a date fill. whats supposed to happen is when the date field is clicked on , the calendar pops up, allows user to push date, and then hides again. Its hidden in the beginning until clicked- then select date, then hides after date fills field.
I'm not sure exactly what controls you are using, but do you have it around the wrong way? is what you mean to do this: Private Sub Initial_Contact_Date_Click() Calendar5.Visible = True Calendar5.SetFocus End Sub Private Sub Calendar5_Click() Initial_Contact_Date = Calendar5.Value Calendar5.Visible = False End Sub Code (markup):
you would also have to set Calendar5.Visible = False either at design or run-time (in the Form_Load event)