Solved

Wildcard entries

Posted on 2013-06-06
6
260 Views
Last Modified: 2013-06-07
I am trying to filter a field "IMA_ItemID"

The Item ID in this field are formatted as follows:

1200-####
1400-####
2600-####

etc.

I'm looking to have check boxes that will include all items selected. I need a wildcard statement which I do not know the syntax for. e.g. "1200*" ; "1400*"

The exact form name is "13frmInventory"

Thanks
0
Comment
Question by:mijwil
[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
6 Comments
 
LVL 77

Expert Comment

by:peter57r
ID: 39226305
Is the ItemID a number field or a text field?
0
 

Author Comment

by:mijwil
ID: 39226430
It is a text field
0
 
LVL 31

Expert Comment

by:Helen Feddema
ID: 39226774
Do you really mean checkboxes?  It seems that a listbox or datasheet subform would be more appropriate for displaying the filtered items.  For filtering by the first 4 characters, something like this query would work:

Filtering File IDs
0
Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

 

Author Comment

by:mijwil
ID: 39226830
Yes I want to use check boxes, radial buttons or something of that nature. I am trying to do this in VBA.

I'm looking to piece together a filter. This form is for inventory value and I have 3000 different items in it. They are categorized in 10 different categories. Lets say I want to analyze how much $$ inventory I have in the 1200 and 1400 categories. I can check off those 2 and see the sum figure at the bottom of my form. I may want to analyze 3 or 4 categories together. I'm looking for something like this:

Dim Item1200 as string
Item1200 = [IMA_ItemID] Like 1200* (this is the line I don't know how to write)

IF Checkbox2 = -1 then
Me.Filter = Me.Filter & " And " & Item1200

etc.....

I think I can figure out all the combinations, I just don't know how to write the line for a wildcard.
0
 
LVL 85

Accepted Solution

by:
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 500 total points
ID: 39229018
Wildcard searches look like this:

Dim sFilter As String
sFilter = " Item LIKE '" & YourValue & "*'"

If YourValue is "1200", then this would find values like 120012, 1200ABC but it would not find AB1200. If you want to find ANY instance of YourValue, you'd do this:

Dim sFilter As String
sFilter = " Item LIKE '*" & YourValue & "*'"
0
 

Author Closing Comment

by:mijwil
ID: 39230341
PERFECT! Thanks for your help. Worked first try.
0

Featured Post

Creating Instructional Tutorials  

For Any Use & On Any Platform

Contextual Guidance at the moment of need helps your employees/users adopt software o& achieve even the most complex tasks instantly. Boost knowledge retention, software adoption & employee engagement with easy solution.

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

726 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