Link to home
Create AccountLog in
Avatar of tahirih
tahirih

asked on

Access - SQL Drop Columns

Please advise on how to DROP two columns from an Acces 2003 Table in one Statement.

The following was unsuccessful:

Alter table A_Trim drop column (Name_First, Name_Last)

Thanks
Avatar of jmoss111
jmoss111
Flag of United States of America image

In DDL you can only execute one statement per querydef; what you typed isn't allowable.
Avatar of tahirih
tahirih

ASKER

Is there a method for me to drop two columns in one Statement in SQL for Access?
Avatar of Rey Obrero (Capricorn1)


you can do it in VBA

CurrentDb.Execute "alter table  A_Trim drop column Name_First, Name_Last"
Avatar of tahirih

ASKER

Can I do this from the Macro tab under Objects, or does it have to be through a Module. I am gaining speed on how to work with Macros and Modules, so more detail is appreciated.

Thanks
ASKER CERTIFIED SOLUTION
Avatar of Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1)
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer
how to do in sql

Alter table A_Trim drop Name_First, Name_Last
right ok, question wasnt accepted when I posted, good luck with your vba method.
Avatar of tahirih

ASKER

Sorry RR, I accepted before I saw your response. I will re-post the question so you can earn deserved points as well
Hi, not to worry, there is no need. I just saw this after I saw your other post and did wonder why. I appreciate the fact that you recognised my efforts though