Name: Capture.PNG Views: 17 Size: 31.0 KB ID: 18878" class="thumbnail" style="float:CONFIG" />
Hi everyone!
As shown above, I have a form with a subform in it. The fields "Price", "Discount", and "Net Price" in the parent form refer to the sums of the fields in the subform. They have the same names so you can easily refer to them.
The "summary" fields in the parent form are actual table fields, and not calculated fields. I enforce consistency in calculating the sums by running some code behind the scenes. Both forms obtain their sources from SQL Server via ODBC. My problem is, every time I enter, edit, or delete some data, the Access form does not immediately display the results, so I need to refresh the forms.
I placed a simple piece of code in the Form_AfterUpdate event of the subform so that every time a record is inserted, edited, or deleted in the subform, the parent form is refreshed to reflect the sums of those three fields. However, when I try to move the cursor away from the current record (by pressing up or down key), the cursor remains in the active row of the datasheet, so I still have to press up or down arrow key again to successfully move to the next row.
An end user will immediately find this behavior frustrating.
Is there a way for me to refresh the parent form whenever I make changes in the subform? I tried tinkering with "Refresh Links" and "ODBC Refresh" but they didn't work for me. I also made sure that the form's recordset type is set to dynaset. These options still do not allow the form to immediately reflect changes in the underlying database data, so I resorted to refreshing or requerying the parent form whenever there are changes made in the subform.
Thank you for helping me. Please let me know if I need to explain my situation in more detail.
Evander