Access 2003 ADP + SQL server migrated to 2008: The Data Was Added to the Database But the Data Won't Be Displayed

StackOverflow https://stackoverflow.com/questions/15478206

Question

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?

Was it helpful?

Solution

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.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top