473,666 Members | 2,208 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Filter by multiple combo boxes

23 New Member
Hi guys,

I was wondering if someone could give me some insight on this. On a form I would like to have 3 combo boxes which can be used as filters. I would like the information to be displayed on a Subform/Subreport and then be able to print a report. For example Filter1, list the company name. Filter2 list the options (open, close). Filter3 is related to the company acct balance, the options are (<$1000, >$1000, >$5000).
I would like to be able to select the company, then view only the open or close accts then select what balances I want to view.
I have created filters on a form before but not on subform. The code I would use for Filter1 and Filter2 is below.

Private Sub Filter1_AfterUp date()
Dim strFilter As String
strFilter = "select * from [Comp_Info] WHERE [CompName]= " & CboName & ";"
Me.RecordSource = strFilter
Me.Requery
End Sub

To create filter3, I am not sure how to go about doing that. If the code above is good for filters 1 & 2, how do I link the filters so that I can filter from one to the other?
How should I approach the subform? I was thinking creating a query with all the companies info and then use the filters to view what accounts I want.
Any help would be greatly appreciated. Thanks in advance.
Jan 15 '07 #1
1 4764
NeoPa
32,568 Recognized Expert Moderator MVP
You're on the right lines but with your three (unbound) filters, you want to have AfterUpdate event procedures for each but all should call a single procedure (MakeFilter) which would then set up a Filter string (strFilter). There is an example of something similar in (Check Boxes to Pass into Query ).
Jan 16 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
4304
by: vgrssrtrs | last post by:
<html> <head> <script language="JavaScript"> <!-- /* *** Multiple dynamic combo boxes *** by Mirko Elviro, 9 Mar 2005 *** ***Please do not remove this comment
3
6606
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 the text value is on a different table. The me.filter is then a text instead of the id-number from the lookup table. This causes the report to prompt for the parameter. How do I get by this problem? Do I need to create a temporary table? I rather...
8
6530
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 there are many examples. BUT, they fail sometimes. The techique is to pass the form's Me.filter as the "where condition" in a Docmd.openreport statement in code behind a "print button" on the form.
2
1713
by: chrisse | last post by:
Hey, I'm having quite a bit of trouble trying to filter through a list using a text box and multiple combo boxes. When you write anything in the text box the list goes blank. Although when you select something from one of the combo boxes nothing happens at all. Help will be greatly appreciated.
6
4619
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 user and I would like to change the whole process. I would like to duplicate the layout of my form... but each field becomes a simple "searching" ListBox. On completing any one search field all the rest are filtered to this value. Subsequent...
1
1341
by: molen malat | last post by:
How do I filter a Query in Access with multiple combo boxes on a Form, such that when selections are made from say four combo boxes at once, they work together like AND statements, but if they are left blank then ALL records are returned, so that the Query is filtered progressively by each combo box selection, and not filtered if no selection is made?
9
15837
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 (actually list boxes) that are multiselects in my main form. I need to use these combo boxes to filter a subform within my main form. My combo boxes are as follows: 1. A - 4 select options 2. B - 10 select options 3. C - 4 select options
1
5625
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 apply the filters to the fields in the report. I would like to use this form to filter the report within a date range (Raised Date From and Raised Date To), using unbound text boxes, without having to specify the criteria within the report's...
1
2862
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 the main form. One (combo box) filters the other. I would like for both boxes to filter the subforms which by the way are on tab controls I have 8 pages. I am very new to vba, but I am trying to get a code that will filter whatever subform is...
1
6794
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 bits of code for different examples. I have one last thing to finish. I am trying to create a search form that will allow users to select criteria from multiple sources eg ,multi select list boxes , combo boxes. I have a subform showing all the...
0
8866
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8781
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8639
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6192
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5663
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4198
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4366
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2011
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1772
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.