ACC2000: Error When You Add Record to a Form That Is Based on a Stored Procedure (248095)
The information in this article applies to:
This article was previously published under Q248095 Advanced: Requires expert coding, interoperability, and multiuser skills.
This article applies only to a Microsoft Access project (.adp).
SYMPTOMS
When you add a record to a form in a Microsoft Access project (ADP) file, you receive the message:
The data was added to the database but the data won't be displayed in the form because it doesn't satisfy the criteria in the underlying record source.
CAUSE
The form is based on a stored procedure that contains multiple tables.
RESOLUTION
Set the ResyncCommand property of the form to an SQL statement that selects the same fields as the stored procedure, and parameterize the primary key field of the table that is designated as the Unique Table. To use the ResyncCommand property of the form to work around this problem, follow these steps:
- Follow steps 1 through 10 of the "Steps to Reproduce Behavior" section later in this article.
- Click OK to clear the error message returned by Microsoft Access.
- Open the form in Design view.
- Set the ResyncCommand property of the form to the following SQL statement:
SELECT Customers.CompanyName AS CompanyName, Customers.ContactName AS
ContactName, Orders.OrderID, Orders.CustomerID, Orders.EmployeeID,
Orders.OrderDate FROM Customers INNER JOIN Orders ON Customers.CustomerID =
Orders.CustomerID WHERE Orders.OrderID = ?
- Save the CustomerOrders form, and then close it.
- Open the CustomerOrders form in Form view.
- Follow steps 8 through 10 of the "Steps to Reproduce Behavior" section later in this article.
Note that the record is saved successfully without generating an error.
REFERENCESFor more information about the ResyncCommand property, click Microsoft Access Help on the Help menu, type ResyncCommand in the Office Assistant or the Answer Wizard, and then click Search to view the topic. For additional information about using the ResyncCommand property in a form, click the article number below
to view the article in the Microsoft Knowledge Base:
239886 ACC2000: How to Simulate AutoLookup with a Stored Procedure in Access Client/Server
Modification Type: | Major | Last Reviewed: | 12/16/2002 |
---|
Keywords: | kbdta kbprb KB248095 |
---|
|