Solved

Wildcard entries

Posted on 2013-06-06
6
251 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
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
Enterprise Mobility and BYOD For Dummies

Like “For Dummies” books, you can read this in whatever order you choose and learn about mobility and BYOD; and how to put a competitive mobile infrastructure in place. Developed for SMBs and large enterprises alike, you will find helpful use cases, planning, and implementation.

 

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 84

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Regardless of which version on MS Access you are using, one of the harder data-entry forms to create is one where most data from previous entries needs to be appended to new records, especially when there are numerous fields and records involved.  W…
I see at least one EE question a week that pertains to using temporary tables in MS Access.  But surprisingly, I was unable to find a single article devoted solely to this topic. I don’t intend to describe all of the uses of temporary tables in t…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
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…

863 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

Need Help in Real-Time?

Connect with top rated Experts

23 Experts available now in Live!

Get 1:1 Help Now