P
Paul Simon
I'm very inexperienced at this so I may have trouble even
explaining my problem.
1.) I have a form named "Form1" in Form View.
2.) Within that form, I have a sub-form named "frm Main"
in Datasheet View.
3.) This "frm Main" sub-form shows records generated by a
query named "qry Main". (This is the only query in the
database.)
4.) I have several macros that run the Action "OpenForm"
in which the Action Arguments indicate Form Name as "frm
Main", View as "Datasheet", Filter Name as "qry Main" and
a Where Condition specific to that macro. So, depending
on which macro I run, the "qry Main" query gives me
different results in the "frm Main" sub-form.
Now what I want to do is to further "filter" this sub-form
as follows.
1.) There is a field entitled "NA". For some records,
this field is blank; for others this field contains the
letter "v".
2.) I'm trying to create an option group (not a toggle
button) at the top of "Form1" that contains 2 option
buttons labeled "vYes" and "vNo".
3.) The purpose of these buttons is to further filter the
records in sub-form "frm Main" (which was developed by
whatever macro I ran).
For example: Let's say I have 1000 records in my
database. I run a macro that results in 20 records
showing in sub-form "frm Main". Of these 20 records, 15
are blank in the "NA" field and 5 have "v" in the "NA"
field. When I click the "vNo" option button, I want to
filter the sub-form so that only the 15 records that are
blank in the NA field show in the sub-form. Then, when I
then click the "vYes" option button, the original 20
records show again.
If another macro generates 30 records with 20 blanks and
10 with "v", then the "vNo" button is to filter the sub-
form to show only the 20 in the sub-form, then
clicking "vYes" would show the 30 again.
Lastly, I want the "vYes" button to be the default.
I know how to place the option group and option buttons on
the "Form1" form, so I don't need help there. I just
don't know how to "code" the buttons to accomplish the
above.
Any detailed help for this complete novice would be
greatly appreciated.
Many thanks,
Paul Simon
explaining my problem.
1.) I have a form named "Form1" in Form View.
2.) Within that form, I have a sub-form named "frm Main"
in Datasheet View.
3.) This "frm Main" sub-form shows records generated by a
query named "qry Main". (This is the only query in the
database.)
4.) I have several macros that run the Action "OpenForm"
in which the Action Arguments indicate Form Name as "frm
Main", View as "Datasheet", Filter Name as "qry Main" and
a Where Condition specific to that macro. So, depending
on which macro I run, the "qry Main" query gives me
different results in the "frm Main" sub-form.
Now what I want to do is to further "filter" this sub-form
as follows.
1.) There is a field entitled "NA". For some records,
this field is blank; for others this field contains the
letter "v".
2.) I'm trying to create an option group (not a toggle
button) at the top of "Form1" that contains 2 option
buttons labeled "vYes" and "vNo".
3.) The purpose of these buttons is to further filter the
records in sub-form "frm Main" (which was developed by
whatever macro I ran).
For example: Let's say I have 1000 records in my
database. I run a macro that results in 20 records
showing in sub-form "frm Main". Of these 20 records, 15
are blank in the "NA" field and 5 have "v" in the "NA"
field. When I click the "vNo" option button, I want to
filter the sub-form so that only the 15 records that are
blank in the NA field show in the sub-form. Then, when I
then click the "vYes" option button, the original 20
records show again.
If another macro generates 30 records with 20 blanks and
10 with "v", then the "vNo" button is to filter the sub-
form to show only the 20 in the sub-form, then
clicking "vYes" would show the 30 again.
Lastly, I want the "vYes" button to be the default.
I know how to place the option group and option buttons on
the "Form1" form, so I don't need help there. I just
don't know how to "code" the buttons to accomplish the
above.
Any detailed help for this complete novice would be
greatly appreciated.
Many thanks,
Paul Simon