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!

Refer to a control as active control

Status
Not open for further replies.

vttech

Technical User
Jan 28, 2006
297
US
I have a function called that GetLogInOut that needs a parameter that is a control. Is there a way that I don't have to type out the name of every control?

since I usually place this code in the event on click
Code:
=GetLogInOut([Name of Control])

something like =GetLogInOut([ME])

Newbie in search of knowledge
 
did me.activecontrol not work for some reason?
 
I get this when I try that approach

the expression on Click you entered as the envent prperty setting produced the following error: The object doesn't contain the automation object 'me.'


Code:
=GetLogInOut(me.activecontrol)

Newbie in search of knowledge
 

Code:
=GetLogInOut(screen.activecontrol)

worked for me thanks

Newbie in search of knowledge
 
I see you put this in the property, but did not write an event procedure.

I did this in my control property and it worked fine
=MsgBox([activecontrol].Name)

so maybe
=GetLogInOut([activecontrol])
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top