473,408 Members | 1,729 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Continuous filtering with a module?

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?
Feb 24 '08 #1
2 1601
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

Feb 24 '08 #2
After re-reading my post this afternoon, I had trouble understanding what I
was asking so let me try to elaborate & clarify!

My table contains a list of products. Each product is described through a
series of yes/no fields which we will call featureA, featureB, etc. The form
has/will have a check box for each of the yes/no fields, ckFeatureA,
ckFeatureB, etc. and a subform which will contain the list of products. The
user will click a checkbox, say ckFeatureA and I want the subform to show
all products where featureA is true. Then the user will check another box,
say ckFeatureB (ckFeatureA is still checked) and the subform will now show
all products where featureA is true and featureB is true. Now if the user
unchecks ckFeatureA, the subform will show all products where featureB is
true only.

The more I have looked at this issue, I am more unsure of how to procede (or
start really, since I'm just spinning my wheels here). It seems that I
somehow need to write a function that would create a query or filter on the
fly and put it in a module so that I could call it from each of the checkbox
afterUpdate events.
"Kevin" <no**@email.comwrote in message
news:%K********************@fe05.news.easynews.com ...
>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?

Feb 25 '08 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: rquinnan | last post by:
Good Evening all, I would greatly appreciate any assistance on this Access 2003 quandary I'm in. And I do apologize if this has been answered somewhere else, I didn't see one that addressed my...
4
by: Kathy | last post by:
What is the standard technique for handling the fields in the following scenario on a continuous form? Multiple Divisions. Each Division has multiple Buildings. Each Building has a Supervisor. ...
5
by: Axel | last post by:
An Access 2000 question Hi is is possible to have (as a subform) a continous form with 0..n buttons which have different images in each row. (Personally I would have preferred a button...
4
by: debbie | last post by:
Well I'm finally trying out class modules...I have a great book I'm using but its ADO and I use DAO so it's a challenge for me...I've looked most of today, in my book and here but can not find an...
6
by: jcrouse | last post by:
I am having problems with a Label_Paint event causing a continuous loop. Here is an explanation of the code. I right click on a label and a context menu pops up. I then select a menu...
7
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I...
5
by: Michael R | last post by:
Searching the net I've found a simple technique to add row numbers and alternate colors (for the even and the uneven row) to a continuous form. 1st step: Create a textbox, send it to background...
6
by: Greg Strong | last post by:
Hello All, Is is possible to use an ADO recordset to populate an unbound continuous Subform? I've done some Googling without much luck, so this maybe impossible, but let me try to explain...
7
by: lrw0831 | last post by:
Hello, I have a few questions. But first I'll give a little bit of info about my database. I'm creating a issue tracker, in a sense. It will be used to enter calls from customers for upgrades,...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

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.