Full Version: Jump to first record in form causes Access to hang
UtterAccess Forums > Microsoft® Access > Access Forms
paulgu
I have a form with subforms that are in Datasheet view format (similar to Customer Orders in Northwind and constructed in the same way). I can jump to the last record in the main form and move one record forward or back without any problem, but most of the time when I attempt to jump to the first record the form displays "Calculating.." , does some flickering in the subforms and then hangs. Sometimes it gets there after a bit of a wait, other times it doesn't.
The main form and subforms don't contain any conditional formatting and the Form_Current code is brief and simple.
The problem never occurs when moving through the records in a forward direction, only backwards. It also doesn't happen if I switch the form into Datasheet View format. It can happen when jumping back to the first record from record 5. The underlying table has about 300 records and the database is single user.
Has anyone else experienced anything similar and found a solution?
Thanks
paulgu
Nobody has come up with any suggestions, but I found my own solution which may be of interest to anyone else who has a similar problem.
What seemed to be happening was that the Form_Current event in the subform was being triggered many times when moving backwards through the records of the main form (I still don't understand why).
So in the Form_Current code for the "master" subform I have added a check as to whether the record in the main form has changed. If not it requeries the "child" subform.
In the Form_Current code for the main form it does the requerying of the child subform, dealing with those cases not covered in the subform. This works well and completely gets rid of the problem.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.