Solved

goto control on a subform

Posted on 2004-04-11
1
410 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

 Watch the Recording: Learning MySQL 5.7

MySQL 5.7 has a lot of new features. If you've dabbled with an older version of MySQL, it is definitely worth learning.

Question has a verified solution.

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

This article shows the steps required to install WordPress on Azure. Web Apps, Mobile Apps, API Apps, or Functions, in Azure all these run in an App Service plan. WordPress is no exception and requires an App Service Plan and Database to install
Recently I was talking with Tim Sharp, one of my colleagues from our Technical Account Manager team about MongoDB’s scalability. While doing some quick training with some of the Percona team, Tim brought something to my attention...
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…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

617 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