Search code examples
mysqlms-accessodbcms-access-2007

MS Access form does not refresh when using ODBC link to MySql


I have a front-end Access 2007 database connecting to MySql tables using MySQL ODBC connector.

The problem is that a form linked to a table will not refresh its data if the data are changed by another user on the network or if the data was changed by a pop-up form.

If I create a VBA code which detects the change and then refresh the form or requery, then the form which shows many records in a table like format, will jump to its top, and some users will lose the sight of the record which is relevant to them and will have to scroll down to find it again which is not always easy.

Previously, when I was using only Access tables on the network, records would be updated on all access forms if data would change, and the forms would not scroll back to the top...

Is ti possible to make Access form autamaticaly refresh its row if data changed on MySql?

One possible solution is if I could get the form to scroll to the exacly same position after the refresh, but not sure if this can be done...


Solution

  • Check the ODBC refresh interval in your Access application. The default value appears to be 1500 seconds. Perhaps a lower value will allow your form to display its updated contents without code intervention.

    Office button -> Access Options -> Advanced, then find ODBC refresh interval near the end of that section of options.

    Newer Versions of Office File -> Options -> Client Settings -> Scroll down to Advanced -> Change ODBC refresh Interval (Sec)

    Also, since you have created code to detect data changes on the server, then refresh the forms in response, you could set a bookmark for the form, refresh, and then return to the bookmarked form row.

    Recordset.Bookmark Property (DAO)

    Update: Changing the form's Recordset Type to Dynaset was the key to resolving this one.