[solved] - VBA - Adding a new record to a table
Morning,
I am trying to add a new record to a table using VBA, I ahve pasted the code I am using below. In the table I have columns called 7A, 7B, 7C etc. However I keep getting the error "Compule error: Expected: end of statement" on the "RST!7A = 1" line. Is the error a result of the field name being 7A or have I written the code wrong? As I don't get the error on any other line.
Thank you
Jessica
Morning,
I am trying to add a new record to a table using VBA, I ahve pasted the code I am using below. In the table I have columns called 7A, 7B, 7C etc. However I keep getting the error "Compule error: Expected: end of statement" on the "RST!7A = 1" line. Is the error a result of the field name being 7A or have I written the code wrong? As I don't get the error on any other line.
Code:
Dim rst As DAO.Recordset
Set db = CurrentDb
Set rst = db.OpenRecordset("HealthQsMEI")
rst.AddNew
rst!AppRefID = appid
rst!7A = 1
rst.Update
rst = Nothing
Jessica
Last edited: