obivous answer

neilb

Board Regular
Joined
Apr 18, 2002
Messages
128
Hi

I am just starting to use access and write a very simple query but I can not seem to get the criteria to work with the wildcard option

What I have is loads of rows witha cell that has 3 numbers in a cell. The numbers can only start with a 1 or 2 or 3. I want to give the user the option to choose what number.

As far as I can get is

Like "[Please enter the first number]*"

but this does not work.

Whats wrong with this?
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
What you are going to have to do is create a new column of all of the first numbers of you long numbers. There is a function "Str" that converts a number to a string, then you can take the left most number and filter by that. One thing I didn't know about Str until I investigated this, is that Str has a leading space before the number for the sign of the number. I could not figure out why left(Str(100),1) was return " " but I looked in the help and it told me. Anyway I had to use the the Mid function to get the first number.

Code:
FirstNum: Mid(Str([Num]),2,1)

Hope this helps!
 
Upvote 0

Forum statistics

Threads
1,221,528
Messages
6,160,343
Members
451,638
Latest member
MyFlower

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top