Input Mask, Updating Current Data

A

Adam Thickett

Hey Peeps,

I'm currently converting an old DOS database to the
latest version of MSAccess. There is a phone number
field that i've added an input mask too on the table, I
don't want to re-input the numbers into the new mask.

Is there a way to auto update the current data to the new
input mask, there must be a way?? If not then a macro to
cut and re-paste the info back into the mask may work??

Please help me :)

Thanks in advance

Adam
 
C

Chris

create a blank copy of the table (with structure only)
Make sure the input mask is on the new table. Copy and
paste the records into the new table. Input masks apply
only to the new records. By pasting them in-they are
considered new records.

If there are too many records to copy and paste-there is
the append query that will copy them from the old table
and paste them to the new one.

Good Luck!!

Chris
 
A

Adam Thickett

I already have over 600 records with data in, i have set
the input mask on the field already. My problem is that
the phone numbers still look like

0114 2782240 rather than (01142) 782240

Any ideas? for an auto update thingy?

Cheers

Adam
-----Original Message-----
Hi Adam

The input mask has no effect on the nature of the data that is stored in
your field - it simply imposes certain rules on the data entry. Or are you
storing the formatting characters (parentheses, spaces etc) from the input
mask in your data?

If you make your phone number field a long integer, and give the textbox on
your form an input mask:
!\(999") "900\ 0000;1;_
and a format:
(000) 000 0000
then there should be no need for data conversion.

--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.

Hey Peeps,

I'm currently converting an old DOS database to the
latest version of MSAccess. There is a phone number
field that i've added an input mask too on the table, I
don't want to re-input the numbers into the new mask.

Is there a way to auto update the current data to the new
input mask, there must be a way?? If not then a macro to
cut and re-paste the info back into the mask may work??

Please help me :)

Thanks in advance

Adam


.
 
T

Tim Ferguson

My problem is that
the phone numbers still look like

0114 2782240 rather than (01142) 782240
I would update them into a new column so that you can check they are right
first, and then remove the old one and rename the new one back. The update
is simply a matter of string slicing

UPDATE MyTable
SET NewPhoneNumber =
"(" & LEFT(OldPhone,4) & MID(OldPhone,6,1) & ") " & MID(OldPhone,7,6)
WHERE LEN(OldPhone)=12;

As noted above, it's nothing to do with input masks at all. If I were you,
I'd junk the IM altogether and use proper validation, either on the
txtPhoneNumber_BeforeUpate event on the form, or as a last resort in the
ValidationRule property on the field.

Hope that helps


Tim F
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top