By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,852 Members | 955 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,852 IT Pros & Developers. It's quick & easy.

Query Parameter Question - True/False Display All...

P: n/a
I've got a form where the user can edit the lookups available in the
database. It consists of a list box of the various categories on the
main form, a checkbox on the main form and a sub form which displays
the lookup values in a datasheet format. When a lookup values is no
longer current, the user can untick the "Active" box in the datasheet
and it will disappear (requeries the subform's recordsource query). On
the main form, I have the checkbox "Display all values", which when
ticked should allow the user to see all lookup values (active and
inactive) for each category.

After much stuffing around and going over newsgroups, I got it to work
by changing the recordsource query of the subform each time the check
box was ticked. Before doing it this way, I tried for some time to get
it to work by having the criteria in the subform's query reference the
checkbox on the main form (IIF([Form]![frmLookup]![ChkBox] = False,
True, True OR False). I could get it to display active (True) when not
ticked, and inactive (False) when ticked by using IIF statement, but
couldn't get it to display both inactive and active (True and False).
Just wondering if I was doing it incorrectly, or if there is a reason
this wouldn't work? Also, is there a better way of doing it aside from
changing the recordsource?

Cheers

Reg

Nov 27 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Changing the RecordSource of the form is a perfectly good solution.
That (or setting the Filter of your subform) is probably the most efficient
approach.

If the main form is unbound, you could manage without it if you prefer. Just
use a Continuous View subform and just put the filter criteria boxes into
the Form Header section. Example screenshot:
http://allenbrowne.com/ser-62.html

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Regnab" <p.*******@gmail.comwrote in message
news:11**********************@l12g2000cwl.googlegr oups.com...
I've got a form where the user can edit the lookups available in the
database. It consists of a list box of the various categories on the
main form, a checkbox on the main form and a sub form which displays
the lookup values in a datasheet format. When a lookup values is no
longer current, the user can untick the "Active" box in the datasheet
and it will disappear (requeries the subform's recordsource query). On
the main form, I have the checkbox "Display all values", which when
ticked should allow the user to see all lookup values (active and
inactive) for each category.

After much stuffing around and going over newsgroups, I got it to work
by changing the recordsource query of the subform each time the check
box was ticked. Before doing it this way, I tried for some time to get
it to work by having the criteria in the subform's query reference the
checkbox on the main form (IIF([Form]![frmLookup]![ChkBox] = False,
True, True OR False). I could get it to display active (True) when not
ticked, and inactive (False) when ticked by using IIF statement, but
couldn't get it to display both inactive and active (True and False).
Just wondering if I was doing it incorrectly, or if there is a reason
this wouldn't work? Also, is there a better way of doing it aside from
changing the recordsource?

Cheers

Reg

Nov 28 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.