private sub txtPhone_check()
if not isnumeric(txtPhone) or len(txtPhone) > 20 then
msgbox "Error in Phone Number"
end if
end sub
to avoid redundancy, see that var = "" is equal : len(var) = 0
you don't need to test it twice, isnumeric already proceed a test of type and consistancy.
look at VB constants ( vbNullstring , vbEmpty , vbTrue , vbFalse ... ) they are "fast access" because of existing in registers of .net and CLR. you'll gain execution time through those constants.
Vb have one hundred of constants for lot of use and components.
String replace will help you to insert the chars()+ you want.