Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change Data Type

Status
Not open for further replies.

ryan1

Programmer
May 15, 2002
106
US
Does anybody know how to change the Data Type of a field in a table using VBA. Any help would be great.
 
Currentdb.Execute _
"ALTER TABLE (table) " & _
"ALTER COLUMN (field) (type)", _
dbFailOnError

 
"ALTER TABLE tblNewItem ALTER ITEM Number;"

Does this look right the table is tblNewItem
The field is Item
I want to change the data type from text to number.

Will this work.I keep getting syntax errors.
 
Try this:

"ALTER TABLE tblNewItem ALTER Item Integer"

 
I forgot column

"ALTER TABLE tblNewItem ALTER COLUMN Item Integer"
 
I'm still getting syntax errors? If i change from alter to ADD Column it works, I'm stumped i've researched everywhere with no luck.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top