Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   Index   Templates   Seminars   TechHelp   Forums   Help   Contact   Join   Order   Logon  
 
Home > TechHelp > Directory > Access > On Filter < Shared Library | Bubble Sort >
Back to On Filter    Comments List
Upload Images   Link   Email  
Field To Filter On is Combobox
Kathy Henry 
      
13 months ago
Hello!  Great video!  I am trying this technique on my database but the field I want to filter on is a ComboBox.  
How do I reference that field?  My code is as follows:

Me.Filter = "DriverTypeCombo = """ & DriverTypeFilter & """"
Me.Filter = True

Using DriverTypeCombo.Col(2) didn't work.
Kevin Robertson 
           
13 months ago
DriverTypeCombo.Column(2)

Are you referencing the correct column? Column 2 would be the third column in the Combo Box.
Kathy Henry OP 
      
13 months ago

Juan C Rivera 
           
13 months ago
Use 0 to refer to the first column, 1 to refer to the second column

V/r
Juan
Kathy Henry OP 
      
13 months ago
Thanks Kevin, I changed the reference to the column.  AND I did change the me.filter to me.filteron  
I sent a msgbox to test the values and the references are now working.   But when I run it, I get a run-time error '3709' that said, "The search key was not found in any record."  
I changed my code to read:      
Me.Filter = "DriverTypeCombo.Column(1) = """ & DriverTypeFilter.Column(1) & """"
Me.FilterOn = True

If I substitute the me.filter to read:  Me.Filter = "Substitute", I get an error message that says enter parameter value for Substitute.
Kathy Henry OP 
      
13 months ago
It's just not recognizing the DriverTypeCombo or DriverTypeCombo.Column(1) as a search parameter.  I will get the values if I msgbox them.  The code I used that worked was referencing the recordsource of teh drivertypecombo, i.e. drivertypeT.

    Me.Filter = "DriverTypeID = " & DriverTypeFilter.Column(0) & ""

Thanks to all who helped out!
Alex Hedley 
            
13 months ago
What's DriverTypeFilter?
Kathy Henry OP 
      
13 months ago
Alex, that is the name of the combo box I'm using to filter which type of (bus) driver I want such as regular, substitute, trainee, etc. see photo above.
Juan C Rivera 
           
13 months ago
Oh just a thought is the record dirty when you try to filter?
Alex Hedley 
            
13 months ago
What's the difference between DriverTypeCombo and DriverTypeFilter?

This thread is now CLOSED. If you wish to comment, start a NEW discussion in On Filter.
 

 
 
 

The following is a paid advertisement
Computer Learning Zone is not responsible for any content shown or offers made by these ads.
 

Learn
 
Access - index
Excel - index
Word - index
Windows - index
PowerPoint - index
Photoshop - index
Visual Basic - index
ASP - index
Seminars
More...
Customers
 
Login
My Account
My Courses
Lost Password
Memberships
Student Databases
Change Email
Info
 
Latest News
New Releases
User Forums
Topic Glossary
Tips & Tricks
Search The Site
Code Vault
Collapse Menus
Help
 
Customer Support
Web Site Tour
FAQs
TechHelp
Consulting Services
About
 
Background
Testimonials
Jobs
Affiliate Program
Richard Rost
Free Lessons
Mailing List
PCResale.NET
Order
 
Video Tutorials
Handbooks
Memberships
Learning Connection
Idiot's Guide to Excel
Volume Discounts
Payment Info
Shipping
Terms of Sale
Contact
 
Contact Info
Support Policy
Mailing Address
Phone Number
Fax Number
Course Survey
Email Richard
[email protected]
Blog RSS Feed    YouTube Channel

LinkedIn
Copyright 2025 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 2/14/2025 7:18:18 AM. PLT: 1s