View Single Post
  #1 (permalink)  
Old 06-21-2008, 08:14 AM
aerohost aerohost is offline
Junior Member
 
Join Date: Jun 2008
Posts: 39
Default Capture name of control that has focus

Hi, I'm trying to get the ID of a form control that has the current focus. It seemed to me the AddEvent in combination with the Sender function would do the trick, but it doesn't seem to work when I try the example in the help.

Here's the code:

Sub App_Start
AddEvent("cbShipName", Click, "FieldGotFocus")
End Sub

FieldGotFocus
Msgbox(Sender)
End Sub

Anyone have any ideas? Do I have to add a library or something like that?

Tks, AB
Reply With Quote