Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there,
I have a form with text boxes on different pages. When a user clicks some of these boxes another form pops up displaying a calendar which is used to fill the aforementioned textbox. This is all fine and good but I need to pass a variable on to the calendar form to tell it which textbox to fill in. So basically I'm having trouble finding a way to capture which textbox was clicked on one form and passing that information on to the other form. Any help would be appreciated! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Andy,
I dit not compleetly build your situation. I created 1 module with: Public clickedBox As Control I created 2 forms On form 1 two textboxes. For the textboxes I filled the Tag property with something. And with the code: Private Sub TextBox1_DblClick(ByVal Cancel As MSForms.ReturnBoolean) Set clickedBox = Me.TextBox1 UserForm2.Show End Sub Private Sub TextBox2_DblClick(ByVal Cancel As MSForms.ReturnBoolean) Set clickedBox = Me.TextBox2 UserForm2.Show End Sub On Form2 1 Label, 1 Textbox and 2 buttions ( OK and cancel) And with the code: Private Sub Cancel_Click() Me.Hide End Sub Private Sub cmdOK_Click() clickedBox.Text = Me.TextBox1.Text Me.Hide End Sub Private Sub UserForm_Activate() Me.Label1.Caption = clickedBox.Tag Me.TextBox1.Text = clickedBox.Text End Sub HTH, Wouter |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Wouter,
With your clear examples I could modify my code to work as needed, so thank you very much! Andy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Textbox values won't change untill clicked on!!!!!!!!!! | Excel Discussion (Misc queries) | |||
Textbox values won't change untill clicked on!!!!!!!!!!! | Excel Discussion (Misc queries) | |||
Userform - Return Control Clicked | Excel Programming | |||
Find a string in a range and return two values based on offsets | Excel Programming | |||
Return Index of Control Object Clicked! | Excel Programming |