Change Table Data Type from VB Code

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi,

I need to set the data type of a field in a Access 2000 Table directly form
VB code, in order to make it automatic when i run a macro.

The table is created from a query and a field is Numeric and i need it to be
text (8 characters) in order to make a link to another table.

Any ideas? i'm completely lost here.

thanks a lot in advance,
Nacho
 
Assuming Access 2000 or later, you can do that by running a query in your
macro, i.e. RunSQL.

The query statement will look something like this:
ALTER TABLE MyTable ALTER COLUMN MyField TEXT(8);"
 
Can you do this for more than one field at the same time or do you need to
have a different query for each one?

Jessica
 
Back
Top