The information in this article applies to:
Moderate: Requires basic macro, coding, and interoperability skills. This article applies only to a Microsoft Access database (.mdb). SYMPTOMSWhen 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: 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. CAUSEIf the SQL Server table has an identity column, when you try to add a record, you instead see what appears to be a duplicate of the previous record. The new record does not display the correct data until you refresh the recordset. This behavior is related to the way Microsoft Access requeries the SQL Server database. RESOLUTIONTo work around this problem, use any of the following three methods. Using an Access ProjectYou 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: Q241743 ACC2000: "Access 2000 Upsizing Tools" White Paper Available in Download Center Q250616 ACC2000: How to Use DTS to Export Data from a Microsoft Access Database to a SQL Server Database Using Forms in an Access DatabaseIf 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.
Using Tables in a MDBIf you see this behavior in a table, you can manually resort the table or close and reopen the table.MORE INFORMATIONSteps to Reproduce Behavior
Additional query words: prb attached 6.5 7.0 refresh down
Keywords : kbdta |
Last Reviewed: January 21, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |