Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding the Focus

Status
Not open for further replies.

kilando

Programmer
May 29, 2003
12
CA
I'm looking for a way to find which control on a form has the focus through visual basic (whatever version ships with Office 2000)

I basically have a form that links to a photo, and when someone is using the navigation buttons (I made, not the little ones at the bottom of a form) they can cause the DB to crash by pressing the button too quickly because Access needs time to load each image.

I wrote a function to disable the buttons, then the function to link the image runs, then a third function runs to enable the images. The problem is I would like to enable the buttons as if nothing had changed (ie, at the end of the enable function, it sets the focus to whatever button had it before the disable function ran)

Does anyone know a function that can determine which control has the focus?

Thanks

 
How about Me.Enabled = False on click of the button before starting the loading of the picture and re-enable it after
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top