SachAccess
Active member
- Local time
- Tomorrow, 01:41
- Joined
- Nov 22, 2021
- Messages
- 409
Hi,
I am getting a Syntax Error while trying to update a table with VBA code.
Please note, I have changed all the names from the below example.
VBA code is getting stuck at below line.
CurrentDb.Execute "Update MyTable set ShortInfo='" & Form_Frm_ABC.Remarks & "', QAZ='" & Form_Frm_ABC.QAZ_ID & "', STATUS=" & Form_Frm_ABC.MyType & " Where MyID=" & Form_Frm_EDC.MyID
Please let me know if you want me to post entire ‘Sub’ here. However, code is getting stuck at this line only.
Can anyone please help me this.
PS - I might revert to this thread on 17-Nov-2022.
I am getting a Syntax Error while trying to update a table with VBA code.
Please note, I have changed all the names from the below example.
VBA code is getting stuck at below line.
CurrentDb.Execute "Update MyTable set ShortInfo='" & Form_Frm_ABC.Remarks & "', QAZ='" & Form_Frm_ABC.QAZ_ID & "', STATUS=" & Form_Frm_ABC.MyType & " Where MyID=" & Form_Frm_EDC.MyID
Please let me know if you want me to post entire ‘Sub’ here. However, code is getting stuck at this line only.
Can anyone please help me this.
PS - I might revert to this thread on 17-Nov-2022.
Code:
Me.Dirty = True
If Form_Frm_ABC.Remarks <> "" Then
MyComm = ""
MyComm = Form_Frm_ABC.Remarks
End If
CurrentDb.Execute "Update MyTable set ShortInfo='" & Form_Frm_ABC.Remarks & "', QAZ='" & Form_Frm_ABC.QAZ_ID & "', STATUS=" & Form_Frm_ABC.MyType & " Where MyID=" & Form_Frm_EDC.MyID