Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Set focus on any object

Tags:

vba

ms-access

How can someone set the focus of an opened Query object within MS Access using VBA?

I am 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
like image 515
Curtis Inderwiesche Avatar asked Mar 16 '09 20:03

Curtis Inderwiesche


People also ask

How do you use set focus?

Use the SetFocus method when you want a particular field or control to have the focus so that all user input is directed to this object. To read some of the properties of a control, you need to ensure that the control has the focus. For example, a text box must have the focus before you can read its Text property.

What is SetFocus in Delphi?

Use SetFocus to change input focus to the control. When a control has focus, it receives keyboard events.

How do you focus a text field in HTML?

Input Text focus() Method The focus() method is used to give focus to a text field. Tip: Use the blur() method to remove focus from a text field.


1 Answers

again docmd is your friend :-)

'set the focus
DoCmd.SelectObject acQuery, myqueryname, False
like image 147
DJ. Avatar answered Sep 24 '22 16:09

DJ.