actually i'm new in programming
and i have a problem with my assignment...

in the assignment, i have to validate the input from the textbox
the input have to contain "SO" and folowed by the 3 to 5 numbers
and i really don't know how to code it.......

plissss someone help me.................

Hi, there are two ways. The more efficient way is to write a regular expression. Read up about that.

Or

Just do this

if left(texbox1.text,2) <> "SO" then
msgbox("missing")
else if length(texbox1.text) <> 5 or length(textbox1.text) <> 7 then
msgbox("length wrong")
elseif isnumeric(right(textbox1.text,3)) =false or isnumeric(right(textbox1.text,5)) = false then
msgbox()
end if

Something like that should do it. You may need to mess around with it.

Thanks a lot........
that is really help me.......
^_^
i have borrowed many books and never found it.
now i can continue my assignment.....

THANKS AGAIN

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.