Pass an object reference to the method that populates the textbox, or use the ActiveControl property to get a reference. For example if your method is called PopulateText, and you run it in the RightClick event to pupolate Text1 with 'Hello' you could use the following code in your RightClick event:
ThisForm.ActiveControl.Value = 'Hello'
The specific answer will vary depending on where your calling your code. Please post a few more details if you need a more specific example.
>I have a textbox on a form. It has focus. I want to enter a variable into this textbox programmatically, which is no problem, but then I cannot figure out how to store the identity of the textbox so I can give it back its focus.
kenweber
GCom2 Solutions
Microsoft Certified Professional