G
Guest
I'm trying to copy fields from a current form to a table not associated with
the form.
All the fields are Text and i'm getting a syntax error on UPDATE command
My code is as follows fired on a onClick button:
Private Sub Go_Click()
On Error GoTo Err_Go_Click
Dim sql As String
If Me.ConfirmCopy = True Then
'Copy fields from Prospect Form to Client Tables
sql = "UPDATE [tblSales_Log] " & _
"SET [Initial_Call_Date] = '" & Me![Initial_Call_Date] & "', " & _
"WHERE [ClientNum] = " & Me![ClientPK]
CurrentDb.Execute sql, dbFailOnError
MsgBox db.RecordsAffected & "Fields Copied"
'MsgBox "Tables Updated", vbOKOnly
Else
MsgBox "Box not checked", vbOKOnly
End If
Err_Go_Click:
MsgBox Err.Description
End Sub
the form.
All the fields are Text and i'm getting a syntax error on UPDATE command
My code is as follows fired on a onClick button:
Private Sub Go_Click()
On Error GoTo Err_Go_Click
Dim sql As String
If Me.ConfirmCopy = True Then
'Copy fields from Prospect Form to Client Tables
sql = "UPDATE [tblSales_Log] " & _
"SET [Initial_Call_Date] = '" & Me![Initial_Call_Date] & "', " & _
"WHERE [ClientNum] = " & Me![ClientPK]
CurrentDb.Execute sql, dbFailOnError
MsgBox db.RecordsAffected & "Fields Copied"
'MsgBox "Tables Updated", vbOKOnly
Else
MsgBox "Box not checked", vbOKOnly
End If
Err_Go_Click:
MsgBox Err.Description
End Sub