Modify a data type using code

  • Thread starter Thread starter Alex
  • Start date Start date
A

Alex

I am trying to change the data type of a table field using
VBA. I need the code that will update a text field to a
number field.

thanks

Alex
 
This example changes a field from whatever it is to a Number of size Double:

Dim strSQL As String
strSQL = "ALTER TABLE MyTable ALTER COLUMN MyField DOUBLE;"
CurrentProject.Connection.Execute strSQL

Requires Access 2000 or above.
 
Back
Top