Dim DB As DAO.Database: Set DB = CurrentDb
Dim Log As DAO.Recordset
Set Log = DB.OpenRecordset("SELECT TOP 1 * FROM Table WHERE NOT IsNull(Field) ORDER BY Id DESC")
On the first run, this query retrieves the correct values.
On subsequent runs, the same initial values are returned, even if the actual record has changed.
For example:
- Released =
01/01/2000
- Recordset returns
01/01/2000
- Released =
12/06/2001
- Recordset returns
01/01/2000
- Open linked table or restart access
- Recordset returns
12/06/2001
I'm assuming there's some caching going on, but I can't find how to ignore it and always fetch the latest records?
CodePudding user response:
You need to refresh your Sharepoint linked table:
CurrentDb.TableDefs("TableName").RefreshLink
Reference to this: