Moderate: Requires basic macro, coding, and interoperability skills.
This article applies only to a Microsoft Access database (.mdb).
SYMPTOMS
When you add a new record to a linked Microsoft SQL Server table and then move to a different record, you may notice one of the following symptoms:
When you press the TAB key to move to the next new record after entering any part of a new record in a table, the record you just typed disappears.When you type a complete new record in a table and then move to an existing record, the record you typed disappears.When you type only part of a new record into a table and then move off that record to an existing record, your new record disappears, and the last record in the table appears to be duplicated.When you type any part of a record in a form, and then leave the record, the information you type disappears.
IMPORTANT: Data is not actually lost. Do not try to add the record again; it does exist. Do not try to delete the apparent duplicate record. By deleting it, you delete the original record, which appears to be duplicated, not the record you just added.
RESOLUTION
To resolve this issue, obtain the latest Microsoft Jet 4.0 service pack update.
For additional information, click the following article number to view the article in the Microsoft Knowledge Base:
239114
How To: Obtain the Latest Service Pack for the Microsoft Jet 4.0 Database Engine
To work around this problem, use any of the following three methods.
Using an Access Project
You can use an Access project instead of an Access database. By using an Access project, you do not need to have linked tables to connect to a SQL Server database.
For additional information about converting your Access database to an Access project, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
241743 ACC2000: "Access 2000 Upsizing Tools" White Paper Available in Download Center
250616 ACC2000: How to Use DTS to Export Data from a Microsoft Access Database to a SQL Server Database
Using Forms in an Access Database
If you see this behavior in a form, use Microsoft Visual Basic for Applications code for the BeforeInsert and AfterInsert events to automatically requery the data and move the form to the newly added record. With the sample code below, you can add to the events to automatically refresh the record on the form.
NOTE: With this method you may notice you have to move off a new record twice. That is, when you add a new record and then press the TAB key or one of the record navigation buttons to add another new record or move to the previous record, you have to press the record navigation button a second time to get to the appropriate record. This does not affect closing the form.
Option Compare Database
Option Explicit
Dim mfRequery As Boolean
Private Sub Form_AfterInsert()
If mfRequery = True Then
' If the variable indicates a Requery
' is needed, Requery the form.
Me.Requery
' Move back to the record that was just added
DoCmd.GoToRecord acDataForm, Me.Name, acLast
mfRequery = False
End If
End Sub
Private Sub Form_BeforeInsert(Cancel As Integer)
If Me.NewRecord = True Then
' If this is a new record, set a variable
' to indicate the need to Requery.
mfRequery = True
End If
End Sub
Using Tables in a MDB
If you see this behavior in a table, you can manually resort the table or close and reopen the table.