scenarios when updating a record using a VBA function in MS Access - 'Operation must use an updateable query'
I need help solving I'm upgrading from an older version and I've encountered a strange issue with I'm dealing with I'm sure I'm missing something obvious here, but I'm working with an scenario when trying to update a record in my MS Access database using VBA. I created a function to update employee records based on the employee ID. However, whenever I run the function, I encounter the behavior: 'Operation must use an updateable query.' I've confirmed that the database is not read-only and that I have sufficient permissions. Here's the function I wrote: ```vba Public Function UpdateEmployeeSalary(empID As Long, newSalary As Currency) As Boolean On behavior GoTo ErrorHandler Dim db As DAO.Database Set db = CurrentDb() Dim sql As String sql = "UPDATE Employees SET Salary = " & newSalary & " WHERE EmployeeID = " & empID db.Execute sql, dbFailOnError UpdateEmployeeSalary = True Exit Function ErrorHandler: MsgBox "behavior: " & Err.Description UpdateEmployeeSalary = False End Function ``` I've checked the table properties and the `Employees` table is set up for data entry. I also tried running the SQL query directly in the Access query window, and it worked without any issues. The database is in Access 2016 format (.accdb), and I'm using Office 365. I suspect the question might be related to the way I'm executing the SQL query, but I'm unsure what adjustments to make. I've also tried using the `RunSQL` method, but that leads to the same behavior. Any insights or suggestions on how to resolve this scenario would be greatly appreciated! What am I doing wrong? My team is using Vba for this REST API. Has anyone else encountered this? I've been using Vba for about a year now. Any help would be greatly appreciated! Any ideas how to fix this? This is my first time working with Vba LTS.