Multiple Criteria Filter

Chalkie42

Registered User.
Local time
Yesterday, 22:08
Joined
Feb 18, 2008
Messages
42
Hi,

I have a form bound to a table and I need to display and edit records. I want to narrow down the records by applying two filters; one combobox to select the ClientID and another to select the date. What I have so far is this:


Private Sub CboClientID_AfterUpdate()

Me.Detail.Visible = True

CboDate.RowSource = "Select AppointmentDate " & _
"FROM tblSample " & _
"WHERE ClientID = '" & CboClientID & "' " & _
"ORDER BY AppointmentDate"
End Sub

then in the cboDate afterupdate event I have:

Private Sub CboDate_AfterUpdate()
Me.Filter = "ClientID = '" & Me.CboClientID & "' AND [AppointmentDate] = #" & Me.CboDate & "#"

Me.FilterOn = True

End Sub

This appears to work with some records and not with others and I don't know why?

Any advice appreciated.
 
Is ClientID a number or text?

Dale
 
ClientID is text. Both the combo boxes are unbound and the filter works fine in that only the relevant dates show up in cboDate but when one is selected some retreive records and some don't. Foramtting is all fine and records do exist for all dates.
 
Did you read the links? Given your location it's likely the problem.
 
Last edited:
Yes I did see the links, I as just answering the previous question.

The Allen Browne link did the trick. Many thanks.
 

Users who are viewing this thread

Back
Top Bottom