Setfocus on continuous subform (also posted on accessvba.com)
I have a time card app with a subform set to continuous forms (see image).
I want the tab key to navigate easily through the subform but it doesn't. I use the recalc function in the change and after_update events on the text boxes for regular and overtime hours. The function makes the cursor action unpredictable. When it runs, the cursor jumps back to the account field and to the 1st record.
The tab order is set appropriately.
I have tried to use setfocus and have it set to the txtOTHours on txtRegHrs update event and it works but it goes to the first record because the object shares the name property for all the records.
Should I be using a recordset to populate the subform and moving the cursor via code? If so, can someone steer me in the right direction?
Thanks in advance.
Mary Lou
I have a time card app with a subform set to continuous forms (see image).
I want the tab key to navigate easily through the subform but it doesn't. I use the recalc function in the change and after_update events on the text boxes for regular and overtime hours. The function makes the cursor action unpredictable. When it runs, the cursor jumps back to the account field and to the 1st record.
The tab order is set appropriately.
I have tried to use setfocus and have it set to the txtOTHours on txtRegHrs update event and it works but it goes to the first record because the object shares the name property for all the records.
Should I be using a recordset to populate the subform and moving the cursor via code? If so, can someone steer me in the right direction?
Thanks in advance.
Mary Lou
Attachments
Last edited: