Hi all,
Stumped once again....
Trying to translate data from a list box into a group of text boxes but placing data in next text box if first is empty. This code just places the same text in all textboxes after the first. I get why its doing it, however not sure how to make it work correctly.
Stumped once again....
Trying to translate data from a list box into a group of text boxes but placing data in next text box if first is empty. This code just places the same text in all textboxes after the first. I get why its doing it, however not sure how to make it work correctly.
VBA Code:
Private Sub listbox1_Click()
If Me.TextBox12.value = "" Then
If Me.ListBox1.value <> "" Then
Me.TextBox12 = Me.TextBox12 & Me.ListBox1
End If
Else
If Me.ListBox1.value <> "" Then
Me.TextBox13 = Me.TextBox13 & Me.ListBox1
End If
'Else
If Me.ListBox1.value <> "" Then
Me.TextBox17 = Me.TextBox17 & Me.ListBox1
End If
'Else
If Me.ListBox1.value <> "" Then
Me.TextBox16 = Me.TextBox16 & Me.ListBox1
End If
'Else
If Me.ListBox1.value <> "" Then
Me.TextBox15 = Me.TextBox15 & Me.ListBox1
End If
'Else
If Me.ListBox1.value <> "" Then
Me.TextBox14 = Me.TextBox14 & Me.ListBox1
End If
'Else
If Me.ListBox1.value <> "" Then
Me.TextBox18 = Me.TextBox18 & Me.ListBox1
End If
'Else
If Me.ListBox1.value <> "" Then
Me.TextBox19 = Me.TextBox19 & Me.ListBox1
End If
'Else
If Me.ListBox1.value <> "" Then
Me.TextBox11 = Me.TextBox11 & Me.ListBox1
End If
End If
End Sub
Last edited by a moderator: