Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Ketut,
Best we turn the earlier suggestion on its head FormA Private Sub TextBox1_Enter() Set InputForm.TB = Me.TextBox1 InputForm.Show End Sub Private Sub TextBox2_Enter() Set InputForm.TB = Me.TextBox2 InputForm.Show End Sub etc. FormB Private Sub TextBox1_Enter() Set InputForm.TB = Me.TextBox1 InputForm.Show End Sub Private Sub TextBox2_Enter() Set InputForm.TB = Me.TextBox2 InputForm.Show End Sub etc. InputForm Public TB As MSForms.TextBox Private Sub ComboBox1_Change() TB.Text = Me.ComboBox1.Value Me.Hide End Sub -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Ketut" wrote in message ... Hi Bob, I apologize for couldn't make it clear. Your earlier input helped me in solving my problem, but now the situation is getting a bit more complex. Now I have 3 userforms. Let's call them FormA, FormB, and InputForm. Both FormA and FormB have 5 textboxes each, while InputForm has a combobox. What I want to achieve this time is, whenever the user click any of the 10 texboxes, the InputForm will be shown. After the user select one value from the combobox in InputForm, this value then will be passed to the textbox that called the InputForm. My problem is I don't know how to make the combobox in InputForm to recognize the form which contains the textbox that called it. I tried to to the following: public MyForm as UserForm public TB as MSForms.TextBox Then at FormA: Private Sub TextBox1_Enter() Set MyForm = FormA Set TB = FormA.TextBox1 InputForm.Show End Sub Similarly in FormB: Private Sub TextBox1_Enter() Set MyForm = FormB Set TB = FormB.TextBox1 InputForm.Show End Sub In InputForm: Private Sub ComboBox1_Change() MyForm.TB.Text = Me.ComboBox1.Value Unload Me End Sub It didn't work..... :( "Bob Phillips" wrote: You have to qualify the TB with the form that it is on. Which form has the TB in this example? -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiple fonts in a VBA UserForm label (to make XL 95 form non-modal) | Excel Programming | |||
Passing value to userform quetion | Excel Programming | |||
Passing Procuedure to Userform | Excel Programming | |||
Passing variables between Sub and Userform | Excel Programming | |||
passing control value from one form to another form | Excel Programming |