[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

On Main Form want to setfocus on Subform

Posted on 2008-11-10
6
Medium Priority
?
312 Views
Last Modified: 2013-11-28
I have a Main form and a subform.  When I open up the main form I would like to put on the OpenForm Event to set focus to the subform.  What would the syntax be for that line of code?

Thanks, Pat
0
Comment
Question by:PatKung
6 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22924017
me.subformName.setfocus
0
 
LVL 75
ID: 22924018
In the main form:

Private Sub Form_Load()

Me.YourSubFormControlName.SetFocus


End Sub

mx
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 22924021
might be better to use the load event of the main form
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 20

Expert Comment

by:clarkscott
ID: 22924026
me.YourSubformname.form.PickAnOjectOnthesubform.setfocus

Scott C
0
 
LVL 75

Accepted Solution

by:
DatabaseMX (Joe Anderson - Microsoft MVP, Access and Data Platform) earned 2000 total points
ID: 22924030
IF ... you want to set focus to a specific control:

Private Sub Form_Load()

Me.YourSubFormControlName.SetFocus
Me.YourSubFormControlName.Form.YourControlName.SetFocus

End Sub

You need both lines in this case.

mx
0
 

Author Closing Comment

by:PatKung
ID: 31515172
That is exactly what I needed!
Thanks, Pat
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

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

Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.
Suggested Courses

834 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