Sure there is but I wouldn't use a CommandButton. Here's a simple example using the ListBox Click() event. Any list item clicked will be put on a new line in the textbox. ' To put each list item on its own textbox line you must first set its Multiline property to ' True at designe time in the Properties window.
Option Explicit Dim strTxt As String Dim i As Integer
Private Sub Form_Load() strTxt = "Item" Text1.Text = "" ' clear the textbox For i = 1 To 10 List1.AddItem strTxt & " " & i Next i End Sub
Private Sub List1_Click() Text1.Text = Text1.Text & List1.Text & vbNewLine End Sub
________________________________________________________________ "So much to learn. So little time to do it. Wise men know it's later than one thinks"! Mark's Syntax.Zip Pause Sub I don't answer programming questions via PMs. That's what the forum is for!
|