mrdominikku
New Member
- Joined
- Jan 25, 2019
- Messages
- 4
Hi there,
I am struggling with events in forms. In brief I am passing information between listboxes on each multipage. Number of pages on multipage control depends on number of specific worksheets. So if user has 4 different tabs with different data, form will be initialized with 4 pages. On each page (renamed with worksheet name) 2 listboxes (first listbox list of available headers from tab , second list of selected headers from first list) are copied from first page.
Second list has additionally second column. This column it's very dependent from client specification so need to be changed on spot. I added double click event on second list box which trigger another small form where user can rename or add second column value. Problem is when there is more than 1 tab on multipage. Event works great only on first tab, can't trigger it on each subsequent one.
So when copying page I creat new listboxes (ListBox4,ListBox6...). I have tried to create new event with matched new listboxes names, but it also does not work.
Any advise or alternative ?
I am struggling with events in forms. In brief I am passing information between listboxes on each multipage. Number of pages on multipage control depends on number of specific worksheets. So if user has 4 different tabs with different data, form will be initialized with 4 pages. On each page (renamed with worksheet name) 2 listboxes (first listbox list of available headers from tab , second list of selected headers from first list) are copied from first page.
Second list has additionally second column. This column it's very dependent from client specification so need to be changed on spot. I added double click event on second list box which trigger another small form where user can rename or add second column value. Problem is when there is more than 1 tab on multipage. Event works great only on first tab, can't trigger it on each subsequent one.
Code:
Private Sub ListBox2_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
For Each ctrl In Me.MultiPage1.Pages(Me.MultiPage1.Value).Controls
If TypeOf ctrl Is MSForms.ListBox Then
If ctrl.Left = 324 Then
'codehere
End If
End If
Next ctrl
End Sub
So when copying page I creat new listboxes (ListBox4,ListBox6...). I have tried to create new event with matched new listboxes names, but it also does not work.
Code:
Private Sub ListBox4_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Private Sub ListBox6_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Any advise or alternative ?