FORMAT

A

alish

Hi all,

I have a table and originally ID column is a text format. Is there any way
to convert it into a number format using a macro? that program is used by
non-ms access users. so i want to make it ealier for them.

Appreciate in advance.
Al
 
G

Graham Mandeno

Hi Al

The only reason you would want to write code to do this is if you need to
perform the operation on many different tables, or across many different
databases. If it's just a one-off then it is *much* easier to do it
manually.

Using code, you must perform the following steps:
1. Create a new field of the required type with a temporary name.
2. Run an update query to copy the data from the old field to the new one.
3. Delete any indexes associated with the old field and create them on the
new field.
4. Delete the old field
5. Rename the new field.

Post a reply back here if you decide you really need to do this and you need
help with the code.
 
A

alish

Yes, i think i will follow that. Thanks.

Graham Mandeno said:
Hi Al

The only reason you would want to write code to do this is if you need to
perform the operation on many different tables, or across many different
databases. If it's just a one-off then it is *much* easier to do it
manually.

Using code, you must perform the following steps:
1. Create a new field of the required type with a temporary name.
2. Run an update query to copy the data from the old field to the new one.
3. Delete any indexes associated with the old field and create them on the
new field.
4. Delete the old field
5. Rename the new field.

Post a reply back here if you decide you really need to do this and you need
help with the code.
--
Good Luck!

Graham Mandeno [Access MVP]
Auckland, New Zealand



alish said:
Hi all,

I have a table and originally ID column is a text format. Is there any way
to convert it into a number format using a macro? that program is used by
non-ms access users. so i want to make it ealier for them.

Appreciate in advance.
Al
 
Top