Filter help

  • Thread starter Thread starter sneagle
  • Start date Start date
S

sneagle

I have a form with two check boxes: NotesNeeded and NotesSent

I would like to be able to click a button and filter the form to show only
records where NotesNeeded is True and NotesSent is false.

My current code is:
Me.Filter = "[NotesSent]>" & -1
Me. FilterOn = True
Me. ReQuery

I am an amateur and I have looked for answers here, but have not found what
I need. Thanks in advance.
 
sneagle said:
I have a form with two check boxes: NotesNeeded and NotesSent

I would like to be able to click a button and filter the form to show only
records where NotesNeeded is True and NotesSent is false.

My current code is:
Me.Filter = "[NotesSent]>" & -1
Me. FilterOn = True
Me. ReQuery

I am an amateur and I have looked for answers here, but have not found
what
I need. Thanks in advance.

You actually typed the criteria you need, here:

"where NotesNeeded is True and NotesSent is false"

Since a Filter is a WHERE sql clause, but without the word WHERE, what you
need is simply:

Me.Filter = "NotesNeeded = True AND NotesSent = False"
Me.FilterOn = True

(you don't need the ReQuery)
 
Thanks, I left work a little early on Thursday and today Friday off. I will
try your answer on Monday.

Thanks again.
Mark
Stuart McCall said:
sneagle said:
I have a form with two check boxes: NotesNeeded and NotesSent

I would like to be able to click a button and filter the form to show only
records where NotesNeeded is True and NotesSent is false.

My current code is:
Me.Filter = "[NotesSent]>" & -1
Me. FilterOn = True
Me. ReQuery

I am an amateur and I have looked for answers here, but have not found
what
I need. Thanks in advance.

You actually typed the criteria you need, here:

"where NotesNeeded is True and NotesSent is false"

Since a Filter is a WHERE sql clause, but without the word WHERE, what you
need is simply:

Me.Filter = "NotesNeeded = True AND NotesSent = False"
Me.FilterOn = True

(you don't need the ReQuery)
 
Back
Top