开发者

ACCESS 2007 Does anyone have an example on how to use the Form.ResyncCommand property?

In my case I have an .adp app that is pointing to a sql server database.

I created a form (with a subform) so that I can have a quick way to put some records in a child table. (there is a join between the parent and the child)

I've deduced that (unless I want to write some code, which shouldn't be necessary) I just need to populate the "Resync Command" field in the subform's Property Sheet

ACCESS 2007 Does anyone have an example on how to use the Form.ResyncCommand property?

MSDN talks about it, but gives no examples.

http://msdn.microsoft.com/en-us/library/bb213742(office.12).aspx

without it, when I update my subform (enters a record into the child table) I get the error:

"Key value for this row was changed or deleted at the data store. The local row is now deleted."

update:

I found THIS, which explains a solution, but I'm not sure what exactly the Sql Statement is trying to do. Can someone explain this?

Error While Inserting Records to a Form

Sometimes when adding a record to an ADP form an error message appears:

“The data was added开发者_Go百科 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.”

For this we have to set the ResyncCommand Property of the Form in the design view to a SQL statement.

For Example: Resync Command: Select * From tblName where FieldName = ?

If the Rowsource contains a stored procedure with multiple tables joined together then the Resync Command Property of the form should be set to an SQL statement that selects the same fields as the stored procedure and parameterize the primary key of the table that is designated as the Unique Table.Table.

btw, I found it here: http://aspalliance.com/989_Migrating_Access_Database_to_SQL_Server.4Table.


Here's an example of using ResyncCommand.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜