Compiler Error....Syntax Error....

M

Michelle

I have the following code and it keeps giving me an error.

Private Sub Command39_Click()
DoCmd.SetWarnings False
DoCmd.RunSQL "INSERT INTO tblESSOld (ESSID, IN_INMNUM, SEP, EXERCISE,
SHOWER, [YARD #], RAZOR, SCREAM, MIRROR, [DATE]), "SELECT (tblESSLog.ESSID,
tblESSLog.IN_INMNUM, tblESSLog.SEP, tblESSLog.EXERCISE, tblESSLog.SHOWER,
tblESSLog.[YARD #], tblESSLog.RAZOR, tblESSLog.SCREAM, tblESSLog.MIRROR,
tblESSLog.DATE)FROM tblESSLog"
DoCmd.RunSQL "DELETE tblESSLog.*", "FROM tblESSLog"
DoCmd.SetWarnings True
End Sub

What it is to do is run a append query then a delete query.
 
D

Duane Hookom

Try something like:

DoCmd.RunSQL "INSERT INTO tblESSOld (ESSID, IN_INMNUM, SEP, " & _
"EXERCISE, SHOWER, [YARD #], RAZOR, SCREAM, MIRROR, [DATE]) " & _
"SELECT ESSID, IN_INMNUM, SEP, EXERCISE, SHOWER, [YARD #], " & _
"RAZOR, SCREAM, MIRROR, [DATE] FROM tblESSLog"
DoCmd.RunSQL "DELETE tblESSLog.* FROM tblESSLog"
 

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

Run SQL 2
Union Query Problem 4
Left Join 2
Join Issues (can not enter data) 1
Union Query Issue 1

Top