Making a range criteria a parameter

Boo

Registered User.
Local time
Yesterday, 16:33
Joined
Aug 30, 2004
Messages
32
You people are so excellent!
I have a query where I want to select records where the name starts with a range of letters. The criteria on the name field so far is Like "[A-C]*"
So far, so good.
Now I want to change the range to something else like D-G.
I want the user to type that in and I do not want them to type it into the query design view. I want the user to be able to type in the range on a field on a form.
I have tried Like "[[Forms![FormName]![FieldName]]*" and then type in A-C.
No worky.
I suspect the problem has to to with both parameters and ranges using brackets.
Thank you for your help.
 
Boo,

Haven't tried it but something like this:

Like "[" & [Forms![FormName]![FieldName] & "]*"

Wayne
 
Thanks for the idea. I could not get it to work.
Any other ideas?
 
Wayne's suggestion works. But you need to put the word Forms in a pair of square brackets.

Like "[" & [Forms]![FormName]![FieldName] & "]*"
.
 
Nice catch Jon!

I had to paste both those lines just to see that I'd forgotten the bracket.

Wayne
 

Users who are viewing this thread

Back
Top Bottom