Full Version: Set Focus On Control On Subform
UtterAccess Forums > Microsoft® Access > Access Forms
burrina
FEmpTotHours is the main form and Payroll Check is the subform and I want to set the focus on the control CheckNo but my code is not working, no errors though. I have tried several combinations, no luck!
[Forms]![FEmpTotHours]![Payroll Check].[Form]![CheckNo].SetFocus
theDBguy
Hi,
Have you tried setting the focus to the subform first?
Just my 2 cents... 2cents.gif
doctor9
burrina,
If you are moving focus from the main form to a control on a subform, you need to first set focus to the subform, THEN move focus to the subform.
Forms!FEmpTotHours![Payroll Check].Form.SetFocus
Forms!FEmpTotHours![Payroll Check].Form!CheckNo.SetFocus
Hope this helps,
Dennis
burrina
Huh, what a trip, that worked! Thanks
burrina
Thanks, different approach but it works as well.
theDBguy
Hi,
Dennis and I were happy to assist. Good luck with your project.
This is a "lo-fi" version of UA. To view the full version with more information, formatting and images, please click here.