Solved

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

Posted on 2013-11-22
4
663 Views
Last Modified: 2013-11-23
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!
0
Comment
Question by:CNeeper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 84

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 300 total points
ID: 39671259
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
 
LVL 11

Assisted Solution

by:Swapnil Nirmal
Swapnil Nirmal earned 200 total points
ID: 39671264
Try this:

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

Open in new window

0
 
LVL 92

Expert Comment

by:Patrick Matthews
ID: 39671927
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
 
LVL 1

Author Closing Comment

by:CNeeper
ID: 39671934
Awesome! Those were the examples I needed! Thanks a million!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It’s the first day of March, the weather is starting to warm up and the excitement of the upcoming St. Patrick’s Day holiday can be felt throughout the world.
This article describes two methods for creating a combo box that can be used to add new items to the row source -- one for simple lookup tables, and one for a more complex row source where the new item needs data for several fields.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

749 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question