Question Field Property Change

Bremen217

Registered User.
Local time
Today, 17:59
Joined
Nov 24, 2010
Messages
19
Hi Guys and Gals!
In an Access 2007 database I have a table with about 1000 total records in it. 2 Columns for these records are telephone and fax numbers that have "()" and "-" in them. I need to remove these and have the columns be integers only. I have tried changing the properties of these columns to "number" instead of "text" but all it does is end up deleting 955 records. Is there a faster way to make this change to numbers only or do I have to manually go in and delete the punctuation. And, yes, each tel and fax number is tied to a GUID.

Thanks!
Bremen
 
You can use the Replace function in an update query...
Code:
sub Test
  with currentdb
    .execute "UPDATE Table SET PhoneNumber = Replace(PhoneNumber, '(', '')"
    .execute "UPDATE Table SET PhoneNumber = Replace(PhoneNumber, ')', '')"
    .execute "UPDATE Table SET PhoneNumber = Replace(PhoneNumber, '-', '')"
  end with
end sub
Use your table name and phone number field name.
Cheers,
 
Lagbolt,
Thank you so much this worked perfectly!
:)
Bremen217
 

Users who are viewing this thread

Back
Top Bottom