1
votes

I have migrated a SQL server 2000 database to SQL Express 2008. Once reassignd roles and permissions, it seems working, however in a form (+subform) when adding new records to the subform, the following error message is given, although the record is still added to the underlying table:

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.

The article here describes a workaround to the problem, however the recordsource is created dynamically; once contents change in the main form, the recordsource property will change in the subform accordingly. Is there a way to fix this?

1

1 Answers

0
votes

According to the article you've linked, you have to create a view and point the record source to that view. Since you don't show the source code, or elaborate on what you mean by "dynamically", then the best suggestion would be to create the view in a ON INSERT, UPDATE trigger in SQL database.

  • ON INSERT, UPDATE trigger on the main table.
    • Generate the dynamic view you need for the subform giving the view a standard name like vwSubForm[PKID] where [PKID] is the primary key for the row.
  • Edit your dynamic record source code to point to the generated view for the subform.