I'm trying to incorporate a calendar onto a combo box. When the user selects the combo box on form, a calendar will appear so they can choose a date and then the form should update with the record matching that information. The problem I am having is when yo click on the combo box and then select the date from the calendar on the form, it updates the combo box but the rest of the form does not change to display the related record. The code I have so far is below:
Please could someone give me some advise on where I am going wrong.
Code:
Private Sub Combo8_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
ocxCalendar.Visible = True
ocxCalendar.SetFocus
ocxCalendar.Value = Combo8.Value
End Sub
Private Sub ocxCalendar_Click()
Combo8.Value = ocxCalendar.Value
Combo8.SetFocus
ocxCalendar.Visible = False
End Sub
Private Sub Combo8_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[Date of Check] = #" & Format(Me![Combo8], "mm\/dd\/yyyy") & "#"
Me.Bookmark = rs.Bookmark
End Sub
Please could someone give me some advise on where I am going wrong.