GotFocus event not running

merry_fay

Registered User.
Local time
Today, 02:00
Joined
Aug 10, 2010
Messages
54
Hi,

I'm trying to run a 'GotFocus' event on one of the text boxes on my form.

Here's the code in progress:

Code:
Private Sub txtCINAME_GotFocus()
    MsgBox "got focus"
End Sub

When I click on the text box, it's not running at all!!!!!!!!
I've tried adding a GotFocus event to other text boxes too, with just a msgbox & they're not running either...

I've checked the properties & the event is definitely linked to the text box.

Any ideas why or what I could have done to stop this event from running?

Thanks
 
Another thing to check is if your event is still linked to the code. Take a look at the event in the properties window and click the three dots to ensure the code is linked.
 
I'm using access 2003 but it's not the code/macro settings being disabled as all the other events are running fine. It's on GotFocus.

Yep, I looked at the properties window, clicked on the 3 dots, several times, check all the words, scratched my head etc etc.

I'm really confused!!
 
working for me

try compiling the whole thing - see if there are some errors stopping this working.
 
I've run into this before and, despite much investigation, have never found an explanation. Sometimes, and I emphasize the sometimes, the GotFocus event won't fire when using the mouse to click into a Textbox. The only workaround I've found, which can be a pain, is to place the same code in the OnClick event for the Control.

Linq ;0)>
 
I'm clutching at straws... does the text box actually lose focus?
 
I'm clutching at straws... does the text box actually lose focus?
Of course, the flip side of that is...does the Textbox receive focus? If you click on a Control that has

Enabled = No
Locked = Yes


it never receives Focus. The same may be true (don't have time to check, now, going out the door) if the Form is Read-Only, for whatever reason.

Linq ;0)>
 

Users who are viewing this thread

Back
Top Bottom