Delete query

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

The following code INSERTS the results from the select query. I would like
to change the code to DELETE the results from the select Query. How would I
do this?

Dim strSQLInsert As String
strSQLInsert = "INSERT INTO tblTeamTask ( TeamObjectiveID, ObjTaskID,
TeamTask )" & _
"SELECT DISTINCTROW qryCorrectTeamObjTasks.TeamObjectivesID,
qryCorrectTeamObjTasks.ObjTaskID, qryCorrectTeamObjTasks.Task" & _
" FROM qryCorrectTeamObjTasks" & ";"

DoCmd.RunSQL strSQLInsert
 
Chris,

I think you mean like this...
strSQLDelete = "DELETE * FROM qryCorrectTeamObjTasks"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

delete query 3
INSERT INTO syntax problem 1
Problem saving new record & "invalid use of null" 7
Handling the darn Apostrophe 4
Apend Query SQL to VBA module 6
Combine queries 10
Run SQL Delete Query 1
INSERT INTO 1

Back
Top