Solved

goto control on a subform

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Suggested Solutions

This article explains all about SQL Server Piecemeal Restore with examples in step by step manner.
Many companies are looking to get out of the datacenter business and to services like Microsoft Azure to provide Infrastructure as a Service (IaaS) solutions for legacy client server workloads, rather than continuing to make capital investments in h…
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…

943 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

Need Help in Real-Time?

Connect with top rated Experts

1 Experts available now in Live!

Get 1:1 Help Now