I have a form with a combo box that has a select query as a Row Source. My code for the cboAfterUpdate event is below. When I select a date from the combo box, the combo box displays a blank and the form shows an empty record 1 of 1 (filtered) --no error message. I can't figure out what is wrong. Thanks for helping.
Code:
Private Sub cboRunDate_AfterUpdate()
' Filter form after date in combo box is selected.
Dim datSelectedDate As Date
' Store date selected in combo box.
datSelectedDate = cboRunDate.Value
' Filter form by valid date.
With Form_frm_DuesInvoicePayment.Form
' If date is greater than 1998, then filter on that value.
If datSelectedDate > #12/31/1998# Then
.Filter = "[RunDate]=" & datSelectedDate
.FilterOn = True
' If date is prior to 1999, remove filter.
Else
.FilterOn = False
End If
End With
End Sub