
passing focus info form form to form
I have an application where many forms call
1 "conversion" form. On the "many" forms, when the user
is in any text box, once the user enters number data in
the box, the user can press a "convert" button that then
opens the "conversion" form and the data from the text
box is displayed and a number of unit conversions can be
selected. Then the conversion form is closed and the new
converted answer is pasted back into the text box on the
form that called the conversion form.
I have this working with one starting form, and I have
the conversion form passing the data back by explictly
identifying the text box it came from. But I want to
call this conversion form from many forms, so I have
tried pasing the name of the form that called the
conversion form, but I cannot seem to use this string in
the command to put the focus back to the orignal form and
text box. Is there away of using a variable name
for "CallingForm" and textbox1" in a lines like:
' this is unloading conversion form and tring to get back
to the calling form...
Private Sub Form_Unload(Cancel As Integer)
'set focus to textbox that called
CallingForm.textBox1.SetFocus
'paste new value in textbox that called
CallingForm.textBox1 = NewValue
end sub
Thanks
Ted