OnGotFocus event

Royce

Access Developer
Local time
Today, 00:40
Joined
Nov 8, 2012
Messages
99
I am trying to set event handlers on multiple controls in code.
This works:
Code:
Me.Controls("txtPosition" & Right(CStr(iLoop + 100), 2)).OnClick = "=UpdateTaskList(" & CStr(iLoop) & ")"

This doesn't:
Code:
Me.Controls("txtPostIt" & Right(CStr(iLoop + 100), 2)).OnGotFocus = "=PostItGotFocusHandler2()"

The second gives an error: "The expression you entered has a function that <databasename> can't find.

I suspect it may be a parameter mismatch, but the normal GotFocus event handler does not take any parameters.

What do I need to do.
 
Is PostItGotFocusHandler2() a Function or a Sub?

Chris.
 
I'm brain dead. It's was a sub. Changed it to a function and all is well. thanks!
 

Users who are viewing this thread

Back
Top Bottom