Design by Sue
Registered User.
- Local time
- Yesterday, 21:08
- Joined
- Jul 16, 2010
- Messages
- 809
Can anyone please tell me where my syntax error is in this code? The error message states syntax error in date in query expression but I am using a similar code elsewhere and I don't get this error. I am sure it is something simple that I am missing - so any assistance as always greatly appreciated.
Dim strSQL As String
strSQL = "Update [SOP Time Table] Set [DateCompleted] = #" & Me.DateCompleted & _
"' And [Employee Number] = '" & ESC(Me.ComboEmpName) & _
"' And [SOP Number] = '" & ESC(Me.ComboSOPNo) & _
"' And [SOPVersion] = '" & ESC(Me.Version) & _
"' And CompletionTime = " & ESC(Me.CompletionTime)
CurrentDb.Execute strSQL, dbFailOnError
DateCompleted is Date/Time
Employee Number is Text
SOP Number is Text
SOPVersion is Number
CompletionTime is Number
FYI ESC is
Function ESC(str) As String
ESC = Replace(str, "'", "''")
End Function
Thanks!
Sue
Dim strSQL As String
strSQL = "Update [SOP Time Table] Set [DateCompleted] = #" & Me.DateCompleted & _
"' And [Employee Number] = '" & ESC(Me.ComboEmpName) & _
"' And [SOP Number] = '" & ESC(Me.ComboSOPNo) & _
"' And [SOPVersion] = '" & ESC(Me.Version) & _
"' And CompletionTime = " & ESC(Me.CompletionTime)
CurrentDb.Execute strSQL, dbFailOnError
DateCompleted is Date/Time
Employee Number is Text
SOP Number is Text
SOPVersion is Number
CompletionTime is Number
FYI ESC is
Function ESC(str) As String
ESC = Replace(str, "'", "''")
End Function
Thanks!
Sue