Oct 16, 2006
On a multipage user form, a combobox control allows the user to select a value from a list, which automatically populates textboxes with other fields from the same list. This works perfectly. I tried to set up another combobox that would work in the same manner, but referencing an entirely separate worksheet and returning the appropriate values from that list to its related textboxes. My problem is that both comboxes are automatically populating ALL the textboxes, ie combobox1 returns the correct information in its related textboxes, but also changes the information in the textboxes related to combobox2. Combobox2 does the same in reverse. I can at least see and understand why this is happening - the combobox code for both is telling ALL textboxes with numerical tags to update.
View 3 Replies
Private Sub cmbPAYERefFirst3Digits_Change()
Dim rFoundSource As Range
Dim strText As String
Dim tBox As Control
If cmbPAYERefFirst3Digits.ListIndex > -1 Then
strText = cmbPAYERefFirst3Digits.Text
Set rFoundSource = Range(cmbPAYERefFirst3Digits.RowSource). Find(What:=strText, _
After:=Range(cmbPAYERefFirst3Digits.RowSource).Cells(1, 1), _
LookIn:=xlValues, LookAt:=xlWhole, SearchOrder:=xlByRows, _
For Each tBox In Me.Controls ...........................