Solved

goto control on a subform

Posted on 2004-04-11
1
395 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Creating and Managing Databases with phpMyAdmin in cPanel.
As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
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…

738 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