Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem using Calendar Control with Combo Boxes

Status
Not open for further replies.

shelds

Programmer
Mar 24, 2005
5
GB
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:

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.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top