Solved

Wildcard entries

Posted on 2013-06-06
6
254 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access 2016 7 34
Ms Access VBA Variables 6 27
Obtaining Access 2013 Runtime file for Sagekey 2013 Installer 3 19
Field naming convntions - MS Access 7 27
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…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

772 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