Visual Basic Validation

Associate
Joined
7 Aug 2008
Posts
302
Alryt lads.

Pretty simple I think. I want to validate a text box in Visual Basic. I.E. for the 'Title' text box I want it so it only allows particular data, e.g. "Mr", "Mrs", "Ms" etc to be entered into that field.

I know I could just use a combo box but Id rather try and do it this way around.

Chears.
 
I havent used vb for a long time so the syntax is lacking (nonexistant :P), but something like this:

if(title.text = "Mr" or "Mrs" or "Ms")//add whatever other validation you need
{
//submit or whatever
}

else
{
//error message
}

I did try something similar too that and I just tried that syntax then. Still getting Type Mismatch error. :/

Weird.
 
Back
Top Bottom