By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,729 Members | 1,356 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,729 IT Pros & Developers. It's quick & easy.

Combo Box Filtering issues

P: 34
I am trying to create a series of combo-boxes that filter the viewable records by the values listed. There are several combo-boxes per form and several thousand records that will be filtered. See attached screenshot for an example.


What I am trying to do is create a filtering rule that filters out all but the values selected in any/all the combo-boxes, while allowing navigation to all the records that match the criteria in the combo boxes.

Here is the very basic filtering rule I have created, but does not seem to be functioning:

Expand|Select|Wrap|Line Numbers
  1. Sub CAR_AfterUpdate()
  2.     Dim rs As DAO.Recordset
  3.  
  4.     If Not IsNull(Me.CAR) Then
  5.         'Save before move.
  6.         If Me.Dirty Then
  7.             Me.Dirty = False
  8.         End If
  9.         'Search in the clone set.
  10.         Set rs = Me.RecordsetClone
  11.         rs.FindFirst "[CAR] = """ & Me.CAR & """"
  12.         If rs.NoMatch Then
  13.             MsgBox "Not found: filtered?"
  14.         Else
  15.             'Display the found record in the form.
  16.             Me.Bookmark = rs.Bookmark
  17.         End If
  18.         Set rs = Nothing
  19.     End If
  20. End Sub
I have used this code on all of my combo-boxes, substituting the appropriate references. I know very little about VB coding and it took me two days just to make this basic filter rule. On a form with a single combo-box this works great for navigating to specific records, but it doesn't work here. Please, any help would be wonderful. Thank you.

** Edit **

Attached Images
File Type: jpg screenie.jpg (65.4 KB, 610 views)
Aug 10 '10 #1

✓ answered by jimatqsi

Perhaps this will help. It is a bytes.com insight article by NeoPa explaining all you need to know about dynamic filtering of a form.

http://bytes.com/topic/access/insigh...filtering-form

Jim

Share this Question
Share on Google+
4 Replies


Expert 100+
P: 1,240
Perhaps this will help. It is a bytes.com insight article by NeoPa explaining all you need to know about dynamic filtering of a form.

http://bytes.com/topic/access/insigh...filtering-form

Jim
Aug 11 '10 #2

P: 34
Thank you. I found that about an hour after I posted this, and the form is working correctly now.
Aug 11 '10 #3

NeoPa
Expert Mod 15k+
P: 31,769
I'm impressed that you realised to post your question in its own thread. I wonder if you realise though, that a link to that same article was already posted in the thread you asked the question in originally.

I'm only curious as I was planning to moderate your post anyway to move it to its own thread, but you did it for me. Saved me a job, which is always good :D
Aug 12 '10 #4

P: 34
Moved to a new thread...
Sep 24 '10 #5

Post your reply

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