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!

Make a text box = Me.ActiveControl

Status
Not open for further replies.

shannonp

IS-IT--Management
Nov 13, 2001
289
NZ
What is the best method of passing the value of the activecontrol on a form to a text box?

Lets say I have 20 text boxes with random text values. I also have a text box which changes to the value of the Active Control. I can do this in vb but am having to repeat the process for each of the 20 text boxes. Am I doing things the hard way?

[yinyang]
Shann
 
Hi,

I hope I understoof your problem correctly. I thin you just need to write a function

Function UpdateCurrentVal()

Me.TxtCurrentVal = Me.ActiveControl.Value

End Function

Call this function on After Update event by selecting all of text boxes and then on properties sheet write

=UpdateCurrentVal()

for After Update Event



Cheers!
ÙÇãá

It's important to learn the rules so that you know how to break them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top