View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
JLGWhiz[_2_] JLGWhiz[_2_] is offline
external usenet poster
 
Posts: 1,565
Default referencing controls in userform from a different workbook

Reverse the path you used to get to the list box that is clicked.

Workbooks("Customers.xls").<userformname.<control name =
<listboxname.value

The form needs to be in show mode when you do it or the control cannot be
accessed.


"David Macdonald" wrote in
message ...
I want to be able to call up the same subform from a number of different
forms in different workbooks.
I have "customers.xls" with a macro to show a form that lists all the
customer names.
The user can be using various forms in different workbooks that need the
exact customer name. So with Application.Run and refernce to the workbook
and
its macro I can open the form.
When the user double-clicks an item in the listbox the value should get
put
into a textbox on the form that called the subform.
I'm missing the final stage - how do I reference the target textbox so
that
the data will go where I want it?

--
WinXP - Office2003 (Italian)