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
Microsoft AccessSQL

Avatar of undefined
Last Comment
rockiroads

8/22/2022 - Mon
jmoss111

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

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



you can do it in VBA

CurrentDb.Execute "alter table  A_Trim drop column Name_First, Name_Last"
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
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
Rey Obrero (Capricorn1)

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
rockiroads

how to do in sql

Alter table A_Trim drop Name_First, Name_Last
rockiroads

right ok, question wasnt accepted when I posted, good luck with your vba method.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
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
rockiroads

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