Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 796
  • Last Modified:

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!
0
CNeeper
Asked:
CNeeper
2 Solutions
 
Scott McDaniel (Microsoft Access MVP - EE MVE )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 NirmalManager, 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

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now