Missing semicolon error???



I am trying to run an Insert query and keep getting a "Rub-time error '3137':
Missing semicolon (;) at end of SQL stement. I haven not seen this error
before; however, I have a form event that triggers the following code to run
(I populate the variables and have other code too, but this is where the
problem lies):

Dim strSQL1 As String
Dim objDB As DAO.Database
Dim objRS As DAO.Recordset

strSQL1 = "INSERT INTO StatusArchive([ID],[Priority],[Prev Activity],[Curr
Activity],[Plan
Activity],[Phase],[Percent],[BeginDate],[Code],[Rank],[Scolor]) Values ( " &
PID & ",'" + CStr(Prty) + "','" + CStr(PrAct) + "','" + CStr(cAct) + "','" +
CStr(PlAct) + "','" + CStr(Phas) + "'," + Pcent + ",'" + CStr(FridayOfWeek) +
"','" + CStr(Cd) + "'," & Rnk & "," & sCol & ") Where [ID] = " & PID & ""

Set objDB = CurrentDb
Set objRS = objDB.OpenRecordset(strSQL1) 'IT ERRORS HERE

Call objRS.Close
Set objRS = Nothing
Set objDB = Nothing

This is what I see in debug (everything is getting populated fine):
"INSERT INTO StatusArchive([ID],[Priority],[Prev Activity],[Curr
Activity],[Plan
Activity],[Phase],[Percent],[BeginDate],[Code],[Rank],[Scolor]) Values (
1,'High','','Test Curr','Test Plan','Complete',1,'Friday, September 12,
2008','C',1,1) Where [ID] = 1"

Thanks in advance,
Al
.



Relevant Pages

  • Re: Missing semicolon error???
    ... (I populate the variables and have other code too, ... Dim objDB As DAO.Database ... Set objDB = CurrentDb ... Set objRS = objDB.OpenRecordset'IT ERRORS HERE ...
    (microsoft.public.access.queries)
  • Re: Missing semicolon error???
    ... This error message occurs because a WHERE clause is meaningless ... Dim objDB As DAO.Database ... Set objDB = CurrentDb ... Set objRS = objDB.OpenRecordset'IT ERRORS HERE ...
    (microsoft.public.access.queries)
  • Re: Missing semicolon error???
    ... Agreed, but if you are going to add the dbFailOnError option, youalso need ... Dim objDB As DAO.Database ... Set objDB = CurrentDb ... Set objRS = objDB.OpenRecordset'IT ERRORS HERE ...
    (microsoft.public.access.queries)
  • Re: How to speed up creation of docs without displaying them.
    ... I think there might be a big speed gain if you can avoid opening and closing the documents. ... Dim objConn As Object ... Set objConn = CreateObject ... Set objRS = objConn.Execute ...
    (microsoft.public.word.vba.general)
  • Re: How to speed up creation of docs without displaying them.
    ... Dim objConn As Object ... Dim strSelectList, strSQL, intCol ... Set objConn = CreateObject ... Set objRS = objConn.Execute ...
    (microsoft.public.word.vba.general)