Mar 26, 2003 #1 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.
Does anybody know how to change the Data Type of a field in a table using VBA. Any help would be great.
Mar 26, 2003 #2 djeeten Programmer Mar 13, 2003 59 BE Currentdb.Execute _ "ALTER TABLE (table) " & _ "ALTER COLUMN (field) (type)", _ dbFailOnError Upvote 0 Downvote
Currentdb.Execute _ "ALTER TABLE (table) " & _ "ALTER COLUMN (field) (type)", _ dbFailOnError
Mar 26, 2003 Thread starter #3 ryan1 Programmer May 15, 2002 106 US "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. Upvote 0 Downvote
"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.
Mar 26, 2003 #4 djeeten Programmer Mar 13, 2003 59 BE Try this: "ALTER TABLE tblNewItem ALTER Item Integer" Upvote 0 Downvote
Mar 26, 2003 #5 djeeten Programmer Mar 13, 2003 59 BE I forgot column "ALTER TABLE tblNewItem ALTER COLUMN Item Integer" Upvote 0 Downvote
Mar 27, 2003 Thread starter #6 ryan1 Programmer May 15, 2002 106 US 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. Upvote 0 Downvote
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.