Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

List Box Question

Status
Not open for further replies.

NewfieGolfer

Technical User
Mar 29, 2001
80
0
0
CA

I have a multiselection list box. After making multiple selections in the list box I need to copy the selected record(s) to a temp table which I have already set up. I was thinking I would use a button to do the copy when pressed. What would I put in the onclick action for the button to copy the records. The records contain 4 fields, all of which need to be copied over to the temp table.


Thanks,

Chris
 
Chris,

I do something similar...

I get away without doing a table write b/c a multi-column listBox can be thought of as an in-memory table... anyway

Hope the following modified snippet helps either way.
Code:
Private Sub OKButton_Click()
    Dim SelectItem As Variant

    If Me.SelectList.ItemsSelected.Count = 0 Then
        MsgBox "You selected no items to process."
        CancelButton_Click
        Exit Sub
    End If

    For Each SelectItem In Me.SelectList.ItemsSelected
        'Process your list items here... one-by-one
    Next
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top