Kevin wrote:
I want to use a set of check boxes to narrow down entries on a subform. I.e.
a check box for black, red & green to describe the colors of a product. So a
use clicks Black and only black products are shown, the click green and only
black and green products are shown. There will be a large number of choices
that a user can make so I'm wondering...
can I right a bit of code or function and put in a seperate module to call
from an after update event of an option group? I"m not real familiar with
using modules or code outside of an objects events.
What I'm thinking is a user clicks the check box for "Black" and the
afterupdate would call function filterResults which could contain code that
would run the list of options, If Black = true then show black products,
else don't show them; if Red = true then...
Does this make sense/ seem like it would be the best way to do it?
This is an off the cuff idea.
I might make a list of colors as a list of values or derived from a
lookup table. I would then have some columns for the color, products,
models, etc in the main (sub) form. Those columns in the form I'd set
to Enabled/Yes, Locked/Yes. This makes them available to see but not
modifiable.
I'd then create a new form that has a list of colors in a combo, the
products, models, costs, and whatever columns are required in the main
form's display. You could have a field in the form called SelectCancel.
And two command buttons...Select and Cancel. In the Select buttons
OnClick event something like
SelectCancel = True
Me.Visible = False
For the Cancel
SelectCancel = False
Me.Visible = False
The color combo in this form
Now in any of those columns in the main form; color, product, etc, put
in the OnDblClick and event to open the form in dialog mode.
Docmd.Openform "ColorProductSelect",,,,,acDialog
If Forms!ColorProductSelect!SelectCancel then
Me.Color = Forms!ColorProductSelect!Color
Me.Product = Forms!ColorProductSelect!Product
etc
Endif
'now close the form
Docmd.Close acForm, "ColorProductSelect"
When the form "ColorProductSelect" is opened, you can grab data from the
main/sub form. Like
Me.Color = Forms!MainFormName!SubformName!Color
Me.Product = Forms!MainFormName!SubformName!Product
With this method you use another form to feed information to your main
form...and visa versa. Editting and modifying data is done in
"ColorProductSelect" and display of data is in the main/sub form.
Lonely Heart
http://www.youtube.com/watch?v=IAY3tupuXyA