Good morning all.
Having issues with loading multiple pages of a multipage from a single worksheet.
the below is the code i am attempting to use, along with the attached workbook. The particular part i am trying to work with is the "AssetsUserform" with combobox3_Change(), once this is completed, the end goal is the click the Assets button on the dashboard, search the database and it auto populates all the pages of the multipage.
Please also note that there is a combobox50 on the service history page of the multipage that i will need to work.
Private Sub ComboBox3_Change()
For j = 1 To UBound(ary1)
If ary1(j, 1) = Me.ComboBox1.Value And ary1(j, 2) = Me.ComboBox2.Value And ary1(j, 3) = Me.ComboBox3.Value Then
AssetsMultiPage.Value = 0
For col = 1 To 18
Me.Controls("TextBox" & col).Value = ary1(j, col)
Next col
rowctr = j
Exit For
End If
Next j
If ary1(j, 1) = Me.ComboBox1.Value And ary1(j, 2) = Me.ComboBox2.Value And ary1(j, 3) = Me.ComboBox3.Value Then
AssetsMultiPage.Value = 1
For col = 19 To 45
Me.Controls("TextBox" & col).Value = ary1(j, col)
Next col
rowctr = j
Exit For
End If
Next j
If ary1(j, 1) = Me.ComboBox1.Value And ary1(j, 2) = Me.ComboBox2.Value And ary1(j, 3) = Me.ComboBox3.Value Then
AssetsMultiPage.Value = 1
For col = 19 To 45
Me.Controls("TextBox" & col).Value = ary1(j, col)
Next col
rowctr = j
Exit For
End If
Next j
If ary1(j, 1) = Me.ComboBox1.Value And ary1(j, 2) = Me.ComboBox2.Value And ary1(j, 3) = Me.ComboBox3.Value Then
AssetsMultiPage.Value = 1
For col = 46 To 56
Me.Controls("TextBox" & col).Value = ary1(j, col)
Next col
rowctr = j
Exit For
End If
Next j
If ary1(j, 1) = Me.ComboBox1.Value And ary1(j, 2) = Me.ComboBox2.Value And ary1(j, 3) = Me.ComboBox3.Value Then
AssetsMultiPage.Value = 1
For col = 57 To 59
Me.Controls("TextBox" & col).Value = ary1(j, col)
Next col
rowctr = j
Exit For
End If
Next j
AssetsMultiPage.Value = 0
Me.TextBox4.SetFocus
End Sub
Cheers
Bookmarks