Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

OpenRecordset doesn't retrieve latest values from Sharepoint Online list

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:

  1. Released = 01/01/2000
  2. Recordset returns 01/01/2000
  3. Released = 12/06/2001
  4. Recordset returns 01/01/2000
  5. Open linked table or restart access
  6. 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?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

You need to refresh your Sharepoint linked table:

CurrentDb.TableDefs("TableName").RefreshLink

Reference to this:

Similar question

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading