Change datatype table field in code

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

Guest

Hi,

I was wondering if it is possible to change the datatype of an existing
field in code ? I was trying something like:
db.TableDefs("Table1").Fields("Field1").Properties ("type") = dbText

but this does not seem to work.

Marco
 
Marco

You can use a DDL query to do this. Code might look like:

strSql = "ALTER TABLE Table1 ALTER COLUMN Field1 CHAR(50)"

DoCmd.RunSql strSql


Ron W
 
Back
Top