Hi all,
I have the below VBA code which used to work perfectly. However, I have moved the access table to SQL and linked it and the code now does not work. The permissions for the table are all set up correctly, so it isn’t that.
My knowledge of VBA recordsets is a bit vague, therefore I was wondering if there is something wrong with the line: dbs.OpenRecordset(“OrderHeader”) and I might need to change something now the table is in SQL? Any help would be much appreciated.
Dim crs As Recordset
Set dbs = CurrentDb()
Set crs = dbs.OpenRecordset(“OrderHeader”)
With crs
.AddNew
!OrderNumber = 148386
!AccountId = 8
!OrderDate = Forms![Menu]![DateSelect]
!TeacherId = 1
!DocumentStatus = “P”
!InvoiceNumber = 180233
!InvoiceDate = Forms![Menu]![DateSelect]
crs.Update
End With