What is the correct syntax for a if - then statement to determine if a specific text box has the focus? Thanks!!
What is the correct syntax for a if - then statement to determine if a specific text box has the focus? Thanks!!
See if the ActiveControl property does what you need.
I found screen.previouscontrol, but I can't figure out the syntax for the if/then statement. Here's what I have, a textbox named "individual", I have a button that the user is able to click on, on the click, I need to determine if the screen.previouscontrol was me.individual. This is what I've tried, if screen.previouscontrol = me.individual then. But this does not work.
I figured it out.
if screen.previouscontrol.name = "individual" then
Thanks for your help!!
Found this using google. Hope it helps
http://bytes.com/topic/access/answers/190351-how-identify-control-has-focus
In VBA help they do this:
Dim ctlPrevious As Control
Set ctlPrevious = Screen.PreviousControl
If ctlPrevious.Name = "txtFinalEntry" Then