Data in Access 2007 sub-form not requeried following updates via SQLServer delete trigger

E

eric

My application is a pretty straight-forward order processing system.

In my Order form I have a OrderItem sub-form. The sub-form contains
an ordered list of items (using an ItemNumber field). I need to be
able to re-arrange the ordering and tidy it up, e.g. when an Item is
removed from the Order.

I have a stored procedure that does the re-ordering and it is invoked
on the Delete trigger on the OrderItem table.

I have tried Requery of the main form and the sub-form on the
AfterDelConfirm event on the sub-form, but the data does not change.
The data is correctly modified in the SQL Server (2000) database and
also displays correclty when I close the form and then re-open it.

Help please!!
 
S

Scott Lichtenberg

I've had issues like this in the past. I'm not sure why requery doesn't
work, but I've generally been able to get around the problem by resetting
the recordsource of the form. Instead of Me.Requery, try Me.Recordsource =
MyRecordsource (can be table, query, SQL statement, etc.)
 
P

Paul Shapiro

I found that I sometimes needed to insert a small delay on the Access side
before the requery. I think the Access AfterDelConfirm event happens before
the SQL Server trigger's changes have been committed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top