"After Update" data macro runs VBA, but SQL SELECT in that VBA returns the pre-update row

68 Views Asked by At

I run a VBA function from an "After Update" data macro via SetLocalVar. This VBA function queries the row that was just updated (taking the table name and a unique ID to select). However, the row that I get is the pre-update row.

So it is as if my function runs before the update, even though it is an "After Update" data macro.

Why is the row not updated by the time my VBA function selects it?

Here is my query:

Dim rs As Recordset
Set rs = MyDB.OpenRecordset("SELECT * FROM " & table & " WHERE " & primaryKey & " = " & primaryId, dbOpenSnapshot)
0

There are 0 best solutions below