Solved

How to set focus on a control in subform when opening main form

Posted on 2013-12-02
2
3,880 Views
Last Modified: 2013-12-02
My main form is named [frm_Menu], the subform is named [frm_indtast] and on this subform is a control named [cboFunktion].

I want to set focus on [cboFunktion] when opening [frm_menu]. How?
0
Comment
Question by:LarsDyrby
[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
2 Comments
 
LVL 61

Expert Comment

by:mbizup
ID: 39689583
Try this in the Open Event of your main form:

Me.[frm_indtast].Form.SetFocus 
Me.[frm_indtast].Form.cboFunktion.SetFocus 

Open in new window



Note - If that doesn't work, you may have to replace frm_indtast with the name of your "subform control" if that is different from the name of your subform as seen in the Navigation Pane.  The  "subform control" is the "frame" in your mainform's design that contains your subform (check the Name property by clicking the edge of your subform in your main form's design and bringing up the property sheet)
0
 
LVL 120

Accepted Solution

by:
Rey Obrero (Capricorn1) earned 500 total points
ID: 39689812
in your form "[frm_indtast]", set the Tab Order so that the combo "[cboFunktion]"  is first on the Custom Order list

in your main form "[frm_Menu]", set the Tab Order so that "frm_indtast" will be on top of the list

No VBA codes needed

but if you want VBA, use

me.[frm_indtast].setfocus
me.[frm_indtast].form.cboFunktion.setfocus
1

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

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

Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
If you need a simple but flexible process for maintaining an audit trail of who created, edited, or deleted data from a table, or multiple tables, and you can do all of your work from within a form, this simple Audit Log will work for you.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Basics of query design. Shows you how to construct a simple query by adding tables, perform joins, defining output columns, perform sorting, and apply criteria.

691 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