Modify a data type using code

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
 
A

Allen Browne

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.
 

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

Top