Free Lessons
Courses
Seminars
TechHelp
Fast Tips
Templates
Topic Index
Forum
ABCD
 
Home   Courses   TechHelp   Forums   Help   Contact   Merch   Join   Order   Logon  
 
Back to On Filter    Comments List
Upload Images   @Reply   Bookmark    Link   Email   Next Unseen 
Field To Filter On is Combobox
Kathy Henry 
      
2 years 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  @Reply  
          
2 years ago
DriverTypeCombo.Column(2)

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

Juan C Rivera  @Reply  
            
2 years ago
Use 0 to refer to the first column, 1 to refer to the second column

V/r
Juan
Kathy Henry OP  @Reply  
      
2 years 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  @Reply  
      
2 years 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  @Reply  
            
2 years ago
What's DriverTypeFilter?
Kathy Henry OP  @Reply  
      
2 years 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  @Reply  
            
2 years ago
Oh just a thought is the record dirty when you try to filter?
Alex Hedley  @Reply  
            
2 years 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.
 

Next Unseen

 
New Feature: Comment Live View
 
 

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 2026 by Computer Learning Zone, Amicron, and Richard Rost. All Rights Reserved. Current Time: 5/1/2026 8:12:25 PM. PLT: 0s