How to set focus on any object in MS Access using VBA

How can someone set the focus of an open Query object in MS Access using VBA?

I'm doing something like this ...

If Application.CurrentData.AllQueries(myqueryname).IsLoaded = True Then 'set the focus ' Export to office links for analysis CommandBars("Menu Bar").Controls("Tools").Controls("Office Links").Controls("Analyze It With Microsoft Office Excel").accDoDefaultAction 
+6
vba access-vba ms-access
source share
1 answer

docmd again - your friend :-)

 'set the focus DoCmd.SelectObject acQuery, myqueryname, False 
+6
source share

All Articles