Form Filter

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a tblProfiles with a field named Type (CG, BG, FA, etc.)

How can I open a form so that it filters out only a specific Type? For example, I want to be able to open the form and have it find only CG types. Is there a code I need to write in the Filter and/or Order By properties of the form

Thanks!
 
In the 4th parameter of the DoCmd.OpenForm command, put in
"[Type] = 'CG'"
You can also put this in the Filter property when the form
is in Design View

Hope This Helps
Gerald Stanley MCSD
-----Original Message-----
I have a tblProfiles with a field named Type (CG, BG, FA, etc.).

How can I open a form so that it filters out only a
specific Type? For example, I want to be able to open the
form and have it find only CG types. Is there a code I need
to write in the Filter and/or Order By properties of the form?
 
Thanks, Gerald! I put this in the Filter property while in Design Mode but when I open the form it doesn't filter for CG

----- Gerald Stanley wrote: ----

In the 4th parameter of the DoCmd.OpenForm command, put i
"[Type] = 'CG'
You can also put this in the Filter property when the for
is in Design Vie

Hope This Help
Gerald Stanley MCS
-----Original Message----
I have a tblProfiles with a field named Type (CG, BG, FA etc.)
specific Type? For example, I want to be able to open th
form and have it find only CG types. Is there a code I nee
to write in the Filter and/or Order By properties of the form
 
If you use the Filter Property, you will need to set the
FilterOn Property to True on the Open or Load Event of the
Form.

It is simple to use a Query with selection criteria
[Type] = 'GA' as the RecordSource for the Form.

HTH
Van T. Dinh
MVP (Access)


-----Original Message-----
Thanks, Gerald! I put this in the Filter property while
in Design Mode but when I open the form it doesn't filter
for CG.
 
Thanks, Van

How do I set the FilterOn Property to True? I'm not real clear on event procedures

----- Van T. Dinh wrote: ----

If you use the Filter Property, you will need to set the
FilterOn Property to True on the Open or Load Event of the
Form

It is simple to use a Query with selection criteria
[Type] = 'GA' as the RecordSource for the Form

HT
Van T. Din
MVP (Access


-----Original Message----
Thanks, Gerald! I put this in the Filter property while
in Design Mode but when I open the form it doesn't filter
for CG
 
If you want to activate the Filter as soon as the Form is opened, you can
use the Form_Open or Form_Load Event. All you need is the statement:

Me.FilterOn = True

OTOH, it may be easier for you (if you are not familiar with VBA code and
haven't got time to learn), you can simply use a Query / SQL String with
selection criteria (same as the filter) as the RecordSource for your Form.
This way, the Form is opened only with the required Records.
 
Back
Top