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?

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

OR

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

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.