I wondered if there was a shortcut to this problem. I started writing a function to do this but I've lost my way a bit... I believe there must be an easier way!!
I have three text fields:
IntSTD - max length 3
AreaSTD - max length 4
Number - max length 8
Together they would form an international phone number, as in: 61-2-95550001
Because they are text fields, a user can potentially (or by mistake) add leading zeros or spaces when they input each number. Also there are some countries with phone numbers shorter than the max length of 8.
Take a number in LA, USA for example. The international version is +1-310-55551234 (in my targeted format). But the user might put "001", "0310" into IntSTD and AreaSTD respectively.
I want to strip out the leading zeros or spaces for all combinations. Here are some other 'hairy' combinations to consider:
IntSTD, AreaSTD, Number
"01 ", "0001", " 551234"
" 1 ", " 001", "05551234"
" 1", " 01", " 5551234"
I started using the Instr function but I didn't want to write 6 different tests (2 chars x 3 fields).
Partially stumped...
L.![[ponder] [ponder] [ponder]](/data/assets/smilies/ponder.gif)
I have three text fields:
IntSTD - max length 3
AreaSTD - max length 4
Number - max length 8
Together they would form an international phone number, as in: 61-2-95550001
Because they are text fields, a user can potentially (or by mistake) add leading zeros or spaces when they input each number. Also there are some countries with phone numbers shorter than the max length of 8.
Take a number in LA, USA for example. The international version is +1-310-55551234 (in my targeted format). But the user might put "001", "0310" into IntSTD and AreaSTD respectively.
I want to strip out the leading zeros or spaces for all combinations. Here are some other 'hairy' combinations to consider:
IntSTD, AreaSTD, Number
"01 ", "0001", " 551234"
" 1 ", " 001", "05551234"
" 1", " 01", " 5551234"
I started using the Instr function but I didn't want to write 6 different tests (2 chars x 3 fields).
Partially stumped...
L.
![[ponder] [ponder] [ponder]](/data/assets/smilies/ponder.gif)