Set Focus

D

dhstein

I'm getting an error message : Run-time error 2110 Micro can't move the
focus to the control btnMyButtonName.

I think it may be that the focus is already there. So my question is what
method shows where the focus is right now - so I can put out a MsgBox for
debugging? Thanks.
 
A

Arvin Meyer [MVP]

That's not the reason. Something else is prohibiting focus. The usual reason
is that the button's visible property is set to No.
 
A

Arvin Meyer [MVP]

I know it isn't because it already has focus because you can add a button
(CommandWhatever) with code that states

Me.CommandWhatever.SetFocus

and it won't break. Click on the button gives it focus. First try setting a
stop (breakpoint) and stepping through your code to see when it actually
breaks. If that doesn't help, try posting the rest of your code for the
routine that you are getting the error.
--
Arvin Meyer, MCP, MVP
http://www.datastrat.com
http://www.mvps.org/access
http://www.accessmvp.com
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top