Filtering a Form

A

Aaron

I have a form called "frmBFEaction" writing to a table called "Entries", I
would like to filter the form to only show the records where field "status"
equals "Open". Could someone please let me know if there is a way to do this
and if so, how?

Thanks in advance for any help!
Aaron
 
F

fredg

I have a form called "frmBFEaction" writing to a table called "Entries", I
would like to filter the form to only show the records where field "status"
equals "Open". Could someone please let me know if there is a way to do this
and if so, how?

Thanks in advance for any help!
Aaron

Create a query that filters the records, i.e.
Select Entries.* From Entries Where Entries.[Status] = 'Open'

Use this query as the form's record source in place of the table.

Only records that are Open will show in the form.
 
M

Marshall Barton

Aaron said:
I have a form called "frmBFEaction" writing to a table called "Entries", I
would like to filter the form to only show the records where field "status"
equals "Open". Could someone please let me know if there is a way to do this
and if so, how?


You could change the form's record source to a query with
that criteria.

How ever, it's usually better (more flexible) to use a form
to open other forms via command buttons. The code behind
the button for open BFE actions would supply the criteria in
the OpenForm method's WhereCondition argument (see VBA Help)
for details.

DoCmd.OpenForm "frmBFEaction", , , "Status='Open' "

This way the form's record source would not have to be aware
of what it is displaying. Then the same form can be used to
see other actions with a different status.
 
C

cyb3rwolf

DoCmd.ApplyFilter , "[status]=Open"

Add that line to whatever event (On Open, button click, etc) on the form.
 

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