Hello guys! I hope you can help me with my concern. So I am trying run the below code to update previously encoded records in the table "lib_gSupp". Under the said table, it has 5 fields namely: (a) gSupp_ID, (b) gName_ID, (c) Supplemental_Information,
(d) Entry_Date, and (e) Date_Modified.
But for the code that I am trying to run, I only need to update 2 fields: (a) Supplemental_Information and (b) Date_Modified.
Below is my code for this but unfortunately I am stuck with an error and the message is this:
"Run-time error '3075': Syntax Error (Missing Operator) in query expression (Me.txt_ed_gSupp).
Dim dbs As DAO.Database, sql As String, rCount As Integer
Set dbs = CurrentDb
sql = "UPDATE lib_gSupp SET Supplemental_Information=" & Me.txt_ed_gSupp _
& ",Date_Modified=" & Now() & " WHERE gSupp_ID=" & Me.txt_ed_gSuppID
dbs.Execute sql, dbFailOnError
rCount = dbs.RecordsAffected
If rCount > 0 Then
MsgBox "Supplemental Information Updated!", , "Update Success"
Me.cmb_ed_gSupp.Requery
Me.cmb_ed_gName.Value = ""
Me.cmb_ed_gSupp.Value = ""
Me.txt_ed_gSupp.Value = ""
Me.cmb_ed_gSupp.Visible = True
Me.txt_ed_gSupp.Visible = False
Me.cmd_Update.Caption = "Edit"
Me.cmb_ed_gName.SetFocus
Exit Sub
End If
The control source of Me.txt_ed_gSuppID is based on the Column(0) of a combobox (cmb_ed_gSupp).
I hope you can help me with this. I have little to no background on programming and MS access. I tried searching the internet but I came with different situation. Thank you!