473,394 Members | 1,746 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,394 software developers and data experts.

Filter by Form with Combo Boxes (A2003)

This is for informational purposes...I had a problem and I thought it
might help others in a similar situation. I hope someone, someday,
finds this idea useful. I've garnered so much knowledge from this
forum over the years, it's nice to present a solution that I couldn't
find here.

I have a form that my users wanted to filter, using the right-click
Filter By or Filter Excluding, etc.

I have a check box which my reports look up, called Select. In other
words, if the record is selected, they want it on the report.

Once they filtered the report, they wanted to be able to, in effect,
click all of them "Select" without having to scroll through all the
records.

Here was the problem, which was sort of addressed elsewhere in this
forum: If they filtered on a combo box (which references another
table), the "query" that could be created and saved references a
"lookup" table, which would essentially fail if I tried to use an
update query to mark all of the filtered records with Select. It was
suggested to change the recordsource of the form to include all the
lookup tables, which would be a good solution, however, one of my
fields changes controlsources based on what is selected in another
field, so I could not change the recordsource to include all tables.

To illustrate so you'll understand, we deal in office equipment, B&W
Copiers, Color Copiers, etc. from various manufacturers. If the user
selects B&W, the model numbers they get to choose from come from the
B&W table. If they choose Color, the model numbers come from another
table. These tables are obtained from an outside source, and are
updated monthly, so I had to go the route of changing the
controlsource after the user chooses. It works brilliantly.

So, how did I "Select" the filtered records, based on whatever filter
the user selected (which can be any, of course)? It was so simple, I
don't know why I didn't think of it sooner. (I've been working on
this most of the day, trying out various solutions).

Here is the code, which I put under a command button:

Private Sub cmdSelectFiltered_Click()

Set rs = Me.RecordsetClone
rs.MoveFirst

Do Until rs.EOF
rs.Edit
rs!Select = True
rs.Update
rs.MoveNext
Loop

rs.Close
Set rs = Nothing

End Sub

Feb 2 '07 #1
0 1874

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

Similar topics

3
by: Richard | last post by:
Hi, I have a form based on a table. When I filter the form I want to run a report based on the same table with the same filter as the form. No problem until I want to filter a combo box where...
8
by: dick | last post by:
I am just trying to print/report the results of a "filter by selection" which is done by right-clicking a form, filling in values, and "applying the filter." I have searched the newsgroups, and...
6
by: Ralph2 | last post by:
Some time ago with a lot of help from this group I made a reasonably successful database to keep track of our shop drawings. However the searching mechanism is too complicated for the occasional...
7
by: Keith | last post by:
A2003, XP Pro SP2. I'm developing a simple custom filter form for a client and keep running into the same error. I've posted a simplified version in my web space at ...
9
by: natwong | last post by:
Hi All, I'm a newbie in terms of Access and some of its functionality . I've been stuck on this problem for a couple days, even after searching the Web, etc. Currently I have five combo boxes...
6
by: bammo | last post by:
MS Access 2003, Windows XP SP2, VBA I have a continuous form that allows edits and filters, but not deletions or additions. I filter the form based on combining selections the user makes in...
1
by: Cara Murphy | last post by:
Hi There! Hoping you are able to help me with a filtering scenario: I have created a pop up form (Filter) to filter a report (Open Issues), which currently has a number of combo boxes which...
1
by: kinglioness | last post by:
Hello All, I am new to this forum so I apologize if this quesiton was asked already. Although i did search but i couldn't find. I have 2 combo boxes one unbound and the other bound they are on...
1
by: woodey2002 | last post by:
Hi Everyone and many thanks for your time.. I am trying to begin access and a bit of VBA i am enjoying it but I have a annoying problem I just can’t get any where on. My databse mostly includes...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.