In a previous thread “Odd Form Behaviour” I was discussing with Charlotte a way to have the cursor jump consistently from a main form to the first field in a subform. She suggested the following code for the OnCurrent event of the subform:
Me.Section(acDetail).Controls(0).SetFocus
On one the forms I used this on, it worked perfectly.
On the other form in the database where I need the same thing to happen, when I put this code in the OnCurrent event of its subform, I get the following error:
Runtime error 2467
The expression you entered refers to an object that is closed or doesn’t exist.
Can anyone suggest where I should look to troubleshoot. Given that the two forms are reasonably similar in design, I am a little confused, not to say frustrated, why the same genereic code will work on one and not the other.
Peter