Using VBA, how can I filter a table using a value in a multivalued field?

I have a table in MS Access 2013 that, among other fields, contains a multivalued field.

Using VBA, I would like to filter the table based on a "normal" field AND by a value that might be contained in the multivalued field.

I already have the following working code in place to filter the table based on the "normal" Manufacturer field, but I'm stuck on adding in the multivalued Categories field.

Me.Filter = "[Manufacturer] = '" & Me.Field_Filter_Manufacturer & "'"
Me.FilterOn = True

Open in new window


Any help would be greatly appreciated!
LVL 1
CNeeperAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
Scott McDaniel (Microsoft Access MVP - EE MVE )Connect With a Mentor Infotrakker SoftwareCommented:
You must refer to the .Value property. For example:

Me.Filter = "[GroupField].Value In (1,2,3)"
Me.FilterOn = True

Or for a single value:

Me.Filter = "[GroupField].Value =1"
Me.FilterOn = True

If the values are Text:

Me.Filter = "[GroupField].Value ='1'"
Me.FilterOn = True
0
 
Swapnil NirmalConnect With a Mentor Manager, Audit AnalyticsCommented:
Try this:

Me.Filter = "[Manufacturer].value = '" & Me.Field_Filter_Manufacturer & "'"
Me.FilterOn = True

Open in new window

0
 
Patrick MatthewsCommented:
Not really an answer to your question, but my advice is to get all Taylor Swift and never ever ever use multi-valued fields.  Really.

:)
0
 
CNeeperAuthor Commented:
Awesome! Those were the examples I needed! Thanks a million!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.