Solved

goto control on a subform

Posted on 2004-04-11
1
380 Views
Last Modified: 2006-11-17
I am learning the basics of VBA.

I have a main form: frm_material_stock_groups and a subform: frm_material_group_subform


upon exiting a field  on the main form I want to go to a control on the subform named Material_Group_Description and i have tried the following line of code which does not work:

 DoCmd.GoToControl (Me!frm_material_group_subform.Form!Material_Group_Description)

Can anyone help?
0
Comment
Question by:supergooner
1 Comment
 
LVL 77

Accepted Solution

by:
peter57r earned 125 total points
ID: 10800636
Hello supergooner,

To go to a control on a subform you have to do it in two steps.

Me!subformcontrolname.setfocus
me!subformcontrolname.Form!Controlname.setfocus


So in your case, assuming the subform control has the same name as the subform:

me!frm_material_group_subform.setfocus
me!frm_material_group_subform.form!Material_Group_Description.setfocus


Pete
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Database tuning – How to start and what to tune. This question is frequently asked by many people, both online and offline. There is no hard and fast rule-of-thumb for performance tuning, however, before beginning the tuning process one should a…
This article describes some very basic things about SQL Server filegroups.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

776 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question