filtering a subform

G

Guest

Hi all
I have a mainform with Familyid field and a subform with familyid field, the
subform record source is a query, the master and child links are set to
familyid which works fine.
i have an unbound option group in main form with active and nonActive options.
now what i want to do is to filter the subform and show only records where
either active = 0 or active =-1 depending on the option group at main form as
this family could have both active and nonActive members.

any help is appreciated.

thank you
 
S

Steve Schapel

K. Shoghi,

Just add a Criteria to the Active field in the query that the subform is
based on, using syntax such as...
[Forms]![NameOfMainForm]![NameOfOptionGroup]
You will need to change the Option Value property of the 2 Option
Buttons in the Option Group to 0 and -1 (probably they will have been
set to 1 and 2 by default).
 
G

Guest

excelent

it did the job, thank you very much

Steve Schapel said:
K. Shoghi,

Just add a Criteria to the Active field in the query that the subform is
based on, using syntax such as...
[Forms]![NameOfMainForm]![NameOfOptionGroup]
You will need to change the Option Value property of the 2 Option
Buttons in the Option Group to 0 and -1 (probably they will have been
set to 1 and 2 by default).

--
Steve Schapel, Microsoft Access MVP


K. Shoghi said:
Hi all
I have a mainform with Familyid field and a subform with familyid field, the
subform record source is a query, the master and child links are set to
familyid which works fine.
i have an unbound option group in main form with active and nonActive options.
now what i want to do is to filter the subform and show only records where
either active = 0 or active =-1 depending on the option group at main form as
this family could have both active and nonActive members.

any help is appreciated.

thank you
 

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