RunCommand

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am using the RunCommand acCmdFind so I can use the find/replace dialog box,
but when it first opens the Look In box is shaded. What I want to do is for
it to open with the look In box recognizing what field is the active field on
the form and showing that field. Is this possible? If so, can you help with
the code or direct me to a good place to find it.

Thank you very much for your help in this matter.
Primepixie
 
Presumably the RunCommand is in the Click event of a command button?

If so, the button has focus when you click it, and Access is therefore
telling you that it is not able to search in a field because no field is
selected.

Nominate the field you want to search, e.g.:
Me.City.SetFocus
RunCommand acCmdFind
or you could tell it to go back to the previous field before the button was
clicked (if there was one):
Screen.PreviousControl.SetFocus
 
Back
Top