Good afternoon,
More of a question as to if this is possible as I cant get my head round it. I have a userform that allows searches for various items and works without issue. I am now trying to incorporate the code that on double click of the a row result in the listbox it then opens the Main Userform and populates all the fields.
Where I am struggling is that the Search listbox only displays 4 of the columns, but the main userform has 35 textboxes. I have seen examples of code for moving the listbox results to the userform but not sure how to get the whole row to effectively populate the userform.
I have populate form code that works on the spin buttons that i thought I may be able to incorporate
This is an extract:
The first column on the list box results is a unique product code so could it be used to then lookup and grab the row information,
Am I over thinking it?
Your help and guidance as always is much appreciated.
More of a question as to if this is possible as I cant get my head round it. I have a userform that allows searches for various items and works without issue. I am now trying to incorporate the code that on double click of the a row result in the listbox it then opens the Main Userform and populates all the fields.
Where I am struggling is that the Search listbox only displays 4 of the columns, but the main userform has 35 textboxes. I have seen examples of code for moving the listbox results to the userform but not sure how to get the whole row to effectively populate the userform.
VBA Code:
Private Sub ListBox2_DblClick(ByVal Cancel As MSForms.ReturnBoolean)
Load UserForm2
UserForm2.TextBox1 = UserForm1.ListBox2.List(UserForm1.ListBox2.ListIndex, 0)
UserForm2.TextBox2 = UserForm1.ListBox2.List(UserForm1.ListBox2.ListIndex, 1)
I have populate form code that works on the spin buttons that i thought I may be able to incorporate
This is an extract:
VBA Code:
Private Sub PopulateForm(SelectedRow As Range)
With SelectedRow
txtItemNo.Value = .Cells(1, 1).Value
txtLocation.Value = .Cells(1, 2).Value
The first column on the list box results is a unique product code so could it be used to then lookup and grab the row information,
Am I over thinking it?
Your help and guidance as always is much appreciated.