Help with Ucase

Febrero127

New member
Local time
Yesterday, 17:44
Joined
Apr 3, 2014
Messages
7
:banghead:Please help I cannot get this to work

I have a form with a textbox name text_loc and users need to enter a row number for example "074"

If I type like "*074*" in the query criteria it works but I need to grab it from the text box and it does not work. How can I get it to run?

Ive tried many ways but cannot get it to work. In criteria I have tried:

ucase ([forms].[form1].[*text_loc*]
ucase ([forms].[form1].*[text_loc]*
ucase ([forms].[form1]."*[text_loc]*"
 

Attachments

  • Untitled.jpg
    Untitled.jpg
    96.2 KB · Views: 131
First, Ucase() needs a closing parenthesis
Ex. ucase("SoMetHinG StRingY") becomes SOMETHING STRINGY

Next, Why are you using UCase? it has no effect on numerical input. Also both O74 and o74 are read the same in the query criteria field.

Anyway, use this syntax when using a field on a form as your criteria

Like "*" & [Forms]![YOURFORM]![YOURFIELD] & "*"

If the entry 074 is in the field then the Query will read like this: Like "*074*"

Cheers!
Goh
 
thanks for letting me know about the UCase. I took it off and added Like "*" &
and it works. Thank you
 

Users who are viewing this thread

Back
Top Bottom