adding - in phone numbers

iuphim

Registered User.
Local time
Today, 01:19
Joined
Oct 30, 2008
Messages
43
What's the easiest way to add in the dashes in the phone numbers?

I have 7574565899 and want 757-456-5899.

Thanks,
 
Look into using a "Mask" on your field or control. Make sure that you specify that you want to store the characters in the field.

HTH
 
If the mask eliminates your data, you may have to loop through the table and manually change them. Use this function after declaring a recordset to do so:
Code:
.movefirst

do until .eof
   .edit
      !phonenumber = left(!phonenumber, 3) & "-" & _
                                   mid(!phonenumber, 4, 3) & "-" & _
                                   right(!phonenumber, 4)
   .update
      .movenext
loop
 

Users who are viewing this thread

Back
Top Bottom