473,952 Members | 7,693 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Apply Filter based on Selection of ComboBox

5 New Member
Okay I am using Access 2007 with several tables and several forms.

The main data is saved to table: Load_Records
There is a Form that updates that table named: Add New Loads To Database
There is another Form used for printing custom reports named: Generate Reports

The Generate Reports form automatically creates and populates a recordset by data binding to the Load_Records table. In the footer of this form there are three combo box's named: CompanySelect, DriverSelect and TruckSelect

The values of the combo box's are populated automatically from tables/columns named: Company!Company , Driver!Driver and Truck!Truck

What I want to do is have ALL THE RECORDS of Load_Records filtered automatically OnChange of any or all of these combo box's.

I have played around with DoCmd.ApplyFilt er but have had no success in getting it to work correctly.
Nov 5 '08
10 13500
ADezii
8,834 Recognized Expert Expert
Sure, but I must warn you I am an amateur with Access in every sense of the word....
Here goes, venuspcs:
  1. Make sure that the On Click() Event of the Apply Filter has [Event Procedure] as its setting.
  2. Copy and Paste this exact code into the Click() Event of the Apply Filter Button. This code has been tested and is operational.
    Expand|Select|Wrap|Line Numbers
    1. Dim strFString As String
    2.  
    3. strFString = "[Company] = '" & Me![cboCompany] & "' And " & _
    4.              "[Driver] = '" & Me![cboDriver] & "' And " & _
    5.              "[mmddyy] = '" & Me![cboDate] & "' And " & _
    6.              "[Truck] = '" & Me![cboTruck] & "'"
    7.  
    8. Me.Filter = strFString
    9. Me.FilterOn = True
Nov 8 '08 #11

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

Similar topics

2
1717
by: seansan | last post by:
Hi, suppose I have one report that reports some data to me based on a functional area that I define. We have about 20 func_areas and every time the report is the same. Is there some way to have the report ask me (based on a query or something) what func_area I would like the report to be based on? ps. the report is based on a query so ultimately the selection has to be passed to the query.
1
3223
by: Cassie Pennington | last post by:
I have tried to filter one combo box based on a selection in another combo box, by using the following sample code: tblfield=forms!!. However, the combobox only seems to recognise the first record, not the current record in order to limit the list? Any suggestions? Thanks in anticipation
16
18455
by: Nhmiller | last post by:
I already have a report designed under Reports. When I use filtering in Forms or Tables, I see no way to select that filtered list when I am in Reports, and there appears to be no way to do the filtering when I am in Reports. I have received two replies to this message, posted a few days ago within another Subject. One requires making programming type statements. That should not be necessary -- Access must have a quick way to just click...
3
4062
by: google | last post by:
This is something I've done plenty of times in '97, but I can't seem to get it to work correctly in Access 2003. Say, for example, I have a form with an unbound combobox, the data source is a table of customers, first column is the key field, which is hidden with a 0" width, and the second column is the customer name. The SQL is a union query that also inserts Null in the first column, and "All" in the second column. That combobox gets...
11
6131
by: Bob | last post by:
I am in the process of upgrading an Access database to SQL Server (and climbing that learning curve!). The wizard happily upgraded all the tables and I can link to them OK using ODBC. The application controls allocation of revisions to aircraft maintenance manuals for an airline type operation. In the application there is a form loaded at start-up allowing the user/s to select the records that they are currently interested in from 4...
2
2141
by: jujubean | last post by:
I have a form with five comboboxes. In the first, the user can select one of four items. The other four comboxes are hidden. Based on the selection made in combobox one, I would like one of the comboxes to be visible, and the other three to remain hidden. Any suggestions? Thanks.
6
6029
by: pouj | last post by:
what i want to do is basically have form where my selection in the combox make the diffrence with what the form reports. this is what the underlying informaion is.... software is access 2007 i got a table where there is name of contacts and with status of away or available then i got form...which has combo box with options AWAY and AVAILABLE and also a command button. then my report has selected colums from the contacts table.
11
20194
by: billa856 | last post by:
Hi, I have project in MS Access.In that I have one form in which there is one combobox .I want to know when I select an item from that combobox and click on submit button then it should open a report which filter data from table.So i only want specific data from table in report based on selection of item from combobox in a form. Can anyone help? Thanks.
1
2800
by: BSTAFFORD | last post by:
I need help. I have a form with a 5 comboboxes. the form also contains a subform query with the saved records from those 5 combobox categories. What I'd like to happen is as a new record is entered and each combobox is updated the subform will automatically filter to the combo box entries. I can get it to filter by one combobox at a time but not all at once. What i'm looking for is like "filter by selection" where the selection is my...
1
2519
by: viranadim | last post by:
I am having problems with attempting to filter a form based on criteria selected in a combo box from another form. I am attempting to filter a form called "Ford CheckList" that is based on a table called "Ford Returned Warranty Parts List". I am using the catagory "Program" that is in a combobox called "Program_Combo" which is located on a form called "Ford Database: Choose an Option". I want the user to open the form "Ford Database: Choose an...
0
10176
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9999
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
11381
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10706
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...
0
9917
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
7451
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
6239
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
6363
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3567
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.