Rod,
It seems you have used delimiters for strings and dates in other parts of the SQL statement. If Mstr is text you need to add delimiters like:
[KronosNotes] = """ & mstr & """ "
Duane Hookom MVP
MS Access
----------------------------------------
> To: MS_Access_Professionals@yahoogroups.com
> From: desertscroller@cox.net
> Date: Sat, 3 Aug 2013 22:19:47 +0000
> Subject: [MS_AccessPros] Need help with query
>
> I am missing something simple in the following query:
>
> dbs.Execute "UPDATE tblKronosEdits " _
> & " SET [Kronos] = '" & kcnt + CboKronosCount.Value & "', [DBUser] = '" & LoggedUser & "', " _
> & " [Date Logged] = #" & LogDate & "#, [KronosNotes] = " & mstr & "." _
> & " WHERE (Employee = " & cboEmployeeName & ") AND (([Date Affected])= #" & tboxKronosDate & "#)"
>
> everything works great without adding the
> [KronosNotes] = " & mstr& &
> section. Get error 3075 Syntax error (missing operator)
>
> mstr = "Initial Kronos edits of 2 logged by Carol on 08/23/2013." & _
> vbCrLf & "Initial Kronos edits of 2 logged by Carol on 08/23/2013."
> (mstr is duplicated for testing purposes at present.)
> mstr was created by copying one string then adding the CrLf character followed by adding the original string to mstr.
>
> mstr = tNotes & vbCrLf
> mstr = mstr & tNotes
>
> The error is associated with the mstr string in the query.
>
> I know it must be something simple.
> Rod
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>
Reply via web post | Reply to sender | Reply to group | Start a New Topic | Messages in this topic (2) |
Tidak ada komentar:
Posting Komentar