J
Jeri
I hope someone has a suggestion here. I've struggled with this issue for an
embarrassing amount of time, and can't find any threads that help. I have
several subforms on several different tabs, with "on update" code that
recalculates fields on a main form. All that code runs fine, but I can't
persuade the focus to return to the subform. Here's the code that begins in a
subform, minus error handling and a lot of lines that work fine. Neither of
the last two commands work, and I'm stumped.
Me.Net.SetFocus
Me.Net = Me.Gross * 0.85
Me.TrainerDue = Me.Gross - Me.Net
- lots of lengthy calculations eliminated here
Forms!frm_Monthly!AfterExpenses.SetFocus
Forms!frm_Monthly!AfterExpenses = Forms!frm_Monthly!NetRevenue -
Forms!frm_Monthly!MonthlyExpenses
'to this point everything works - I've tried lots of solutions, including
these:
Forms!frm_Monthly!subfrm_MP3History.Form![Net].SetFocus
'although the [Net] field on the subform is highlighted, focus remains on
[AfterExpenses] on the main form
DoCmd.GoToRecord acDataForm, "Forms!frm_Monthly!subfrm_MP3History", acNewRec
'(returns error message that subform isn't open)
Any thoughts?
embarrassing amount of time, and can't find any threads that help. I have
several subforms on several different tabs, with "on update" code that
recalculates fields on a main form. All that code runs fine, but I can't
persuade the focus to return to the subform. Here's the code that begins in a
subform, minus error handling and a lot of lines that work fine. Neither of
the last two commands work, and I'm stumped.
Me.Net.SetFocus
Me.Net = Me.Gross * 0.85
Me.TrainerDue = Me.Gross - Me.Net
- lots of lengthy calculations eliminated here
Forms!frm_Monthly!AfterExpenses.SetFocus
Forms!frm_Monthly!AfterExpenses = Forms!frm_Monthly!NetRevenue -
Forms!frm_Monthly!MonthlyExpenses
'to this point everything works - I've tried lots of solutions, including
these:
Forms!frm_Monthly!subfrm_MP3History.Form![Net].SetFocus
'although the [Net] field on the subform is highlighted, focus remains on
[AfterExpenses] on the main form
DoCmd.GoToRecord acDataForm, "Forms!frm_Monthly!subfrm_MP3History", acNewRec
'(returns error message that subform isn't open)
Any thoughts?