471,355 Members | 1,580 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,355 software developers and data experts.

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

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
1 3717
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.

Similar topics

3 posts views Thread by Harvey | last post: by
4 posts views Thread by Martin Biddiscombe | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.