Private Sub Command1_Click()
'INIT LIST1
With Me.List1
.AddItem "a"
.AddItem "b"
.AddItem "c"
End With
'INIT LIST2
With Me.List2
.AddItem "1"
.AddItem "2"
.AddItem "3"
End With
'INIT TEXT1-4
Me.Text1.Text = ""
Me.Text2.Text = ""
Me.Text3.Text = ""
Me.Text4.Text = ""
End Sub
Private Sub List1_Click()
AddText Me.List1.Text
End Sub
Private Sub List2_Click()
AddText Me.List2.Text
End Sub
Private Sub AddText(ByVal txt As String)
If Me.Text1.Text = "" Then Me.Text1.Text = txt: Exit Sub
If Me.Text2.Text = "" Then Me.Text2.Text = txt: Exit Sub
If Me.Text3.Text = "" Then Me.Text3.Text = txt: Exit Sub
If Me.Text4.Text = "" Then Me.Text4.Text = txt: Exit Sub
End Sub
here's a 2nd way-
AddText "init" to restart adding text to textbox 1-4
Private Sub AddText(ByVal txt As String)
Static x As Byte
If txt = "init" Then x = 0:Exit Sub
x = x + 1
Select Case x
Case 1: Me.Text1.Text = txt
Case 2: Me.Text2.Text = txt
Case 3: Me.Text3.Text = txt
Case 4: Me.Text4.Text = txt
End Select
End Sub