hello please help me on this...i have txt1.text that can input only pcs and ream ..my problem that if the user will use the uppercase PCS it will not accept because my trapping is..

if Trim(txt1.text) <> "pcs" and Trim(txt1.text) <> "ream" then
msgbox "please input pcs and ream"
exit sub
end if

please help me on this how to accept "PCS" or "pcs" and "REAM" or "ream"....hoping for your positive responds..does the vb6.0 has a built in function just like java ignorecase?

8 Years
Discussion Span
Last Post by jemz

Hi jemz,
you can use the ucase function which stands for the upper case(Returns the uppercase of a string) or
the lcase which stands for the lower case(returns the lower case of a string)...
For example:

if Trim(UCASE(txt1.text)) <> "PCS" and Trim(UCASE(txt1.text)) <> "REAM" then


if Trim(LCASE(txt1.text)) <> "pcs" and Trim(LCASE(txt1.text)) <> "ream" then

Good luck..


hi Jemz,

one way of doing this is how KSS told, the other way is to restrict the user to select the values from a list box... in this case you may not even require aditional validation if it is some specific value.

this is applicable only if the values constant set of values.


oki thank you for helping me i will try this...more power to you

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.