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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ALTER COLUMN statement won't work

Status
Not open for further replies.

charlieasp

Programmer
Apr 3, 2001
1
Does anyone know why my ALTER COLUMN statement won't work?

I'm creating a new version of an existing single user multi-site database. There is a vaste amount of data in the db's and so I can only update the forms/reports etc but the user wants a format change on one of the tables.

Basically I've got a button that will hide itself once called which I'd like to set so that it'll go to the table and change a field's data size from 'integer' to 'single'

What I've done:

Dim db As Database
Dim strSQL As String
Dim alterer As QueryDef

Set db = CurrentDb

'strSQL = "ALTER TABLE Test ADD COLUMN Salary3 SINGLE"
strSQL = "ALTER TABLE Test ALTER COLUMN Salary3 INTEGER"

Set alterer = db.CreateQueryDef("", strSQL)
alterer.Execute

The 'add column' statement works perfectly but the alter column doesn't and throws a:

Run-time error '3293'
Syntax Error in ALTER TABLE statement

I've looked through the help and tried different words and brackets etc but I can't crack it!

Thanks in advance,

Charlie

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top