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!

active field 1

Status
Not open for further replies.

rene1000

IS-IT--Management
Apr 9, 2002
89
NL
I want to create a button which inputs the date into the current active field (with the focus on it). Therefore i need to read the current active field name. How can i do this ?
 
Well, if you want to refer to the name of the current field, you would use Screen.ActiveControl.Name

But if you want to click a button and put a value in that field, that won't work, because as soon as you click the button, the button gains focus and the other field is no longer the current control. In that case, you'd use Screen.PreviousControl, i.e. to insert the current date:

Code:
Screen.PreviousControl = Date

HTH...

Ken S.
 
Thank you very much Ken, it works great and it was very helpfull.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top