Fizza Akram
Fizza Akram

Reputation: 11

Changes in MS Access Form Not Automatically Updating Linked Tables in SQL Server

I am currently working on a Microsoft Access database where I have linked tables connected to a SQL Server backend. The setup involves a form in Access through which users make changes to the data. However, I've encountered an issue where changes made in the Access form only reflect the changes to the local tables of MS Access .But what I want is that it should also reflect changes to the linked tables of SQL server added through ODBC.

Details

Code Example Here is an example of the VBA code used in the AfterUpdate event:

Private Sub frmJobs_AfterUpdate()
    ' Save the current record
    DoCmd.DoMenuItem acFormBar, acRecordsMenu, acSaveRecord, , acMenuVer70

    ' Refresh the linked table
    CurrentDb.TableDefs("dbo_tblJobs").RefreshLink
End Sub

What could be causing this issue, and how can I ensure that changes made in the Access form are automatically reflected in the linked tables on SQL Server?

Additional Details

Any help would be appreciated.

Upvotes: 1

Views: 318

Answers (1)

Gustav
Gustav

Reputation: 55806

Refresh the form:

Private Sub frmJobs_AfterUpdate()

    ' Save the current record.
    Me.Dirty = False

    ' Refresh the form. Should not be needed.
    Me.Refresh

End Sub

Upvotes: 0

Related Questions