View Full Version : Making a range criteria a parameter


Boo
09-04-2004, 09:49 PM
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.

WayneRyan
09-04-2004, 10:55 PM
Boo,

Haven't tried it but something like this:

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

Wayne

Boo
09-05-2004, 10:07 AM
Thanks for the idea. I could not get it to work.
Any other ideas?

Jon K
09-05-2004, 05:01 PM
Wayne's suggestion works. But you need to put the word Forms in a pair of square brackets.

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

WayneRyan
09-05-2004, 05:26 PM
Nice catch Jon!

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

Wayne