Filter button to Filter by 2 fields

  • Thread starter Thread starter dee
  • Start date Start date
D

dee

I'd like to filter by the following criteria:

left(LeadDisposition,3) = "Sit" AND Appt_Date = Text767

I have no idea how to do this. Appreciate help.
 
Filter what?

Show only those records of the form 'FmLeads' where the leftmost 3
characters of the field 'LeadDisposition' ="Sit", and where the value
of the field 'Appt_Date' = the value of the field 'Text767'.
The form is already open. To activate the filter, a button is pressed.
 
Put the code in the Click event of the button

Me.Filter = Left(LeadDisposition,3) = "Sit" AND Appt_Date = Me.Text767
Me.FilterOn = True
 
Put the code in the Click event of the button

Me.Filter= Left(LeadDisposition,3) = "Sit" AND Appt_Date = Me.Text767
Me.FilterOn = True

Thanks Dave, but it does not work.
When I press the button, it only shows 1 new empty record.
There are about a dozen or so qualifying records to display.
 
Try changing it to
Me.Filter= Left(LeadDisposition,3) = "Sit" AND Appt_Date = "#" & Me.Text767
& "#"
 
Is LeadDisposition a field in the form's record source?
If so, is it a text data type?
Is APPT_DATE a date field?
If so, does it contain only a date or does it contain date and time?
 
Is LeadDisposition a field in the form's record source?
If so, is it a text data type?
Is APPT_DATE a date field?
If so, does it contain only a date or does it contain date and time?

LeadDisposition is a text field
APPT_DATE is a date field formatted as 'ddd dd mmm yy' medium date
only in both 'Appt_Date' and 'Text767'.

By the way, I got part of it working,

Me.Filter = "left(LeadDisposition,3) = 'Sit'"

Can't get the rest working Dave.
 
Sorry about that. Try this version.
Me.Filter= "Left(LeadDisposition,3) = 'Sit' AND Appt_Date = #" & Me.Text767
& "#"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top