Filter help

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.
 
S

Stuart McCall

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)
 
S

sneagle

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)
 

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

Top