Solved

Wildcard entries

Posted on 2013-06-06
6
249 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
IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

 

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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

708 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

12 Experts available now in Live!

Get 1:1 Help Now