I am dealing with text fields for which I need to control the format.
There are various fields and each of them as its specific format.
For example, if [Phone Numbers] must look like (+XXX YYYYYYYYY), I
want to make sure that the content matches it. I know I can parse the
string make appropriate tests but given the # of formats I have to
look after, I'm more looking for an object or something that would do
this job in one statement.
Thanks in anticipation for any help.
Jacques.-
Look into using the Like operator (check out VB's help files for the
various formatting checks it can make).
I'm not sure of what the significance of you using "X" and "Y" in your
sample, I thought they are all digits, but I think this would do what
you want for phone numbers...
If YourPhoneNumberAsText Like "(+### #########)" Then
' Phone number format is valid
Else
' it not valid.
End If
Rick - MVP
Sign up now to help keep VB support alive -
http://classicvb.org/petition