Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2003

    Unanswered: Multiselect help - URGENT!!

    I have created a unbound listbox that grabs data from another table. I then put a listbox on the form that the data will go to. I then created an Add Button to send the data selected from the unbound listbox to the other. I am not able to store the selected items in a table. I can see the items transferred to the other listbox, but not stored in my table. Please help. Here is the code for the add button. If i need something else please let me know. Code is:

    Private Sub add_button_Click()
    Dim listcounter As Integer, currentcounter As Integer
    Dim listitems As Integer, currentitems As Integer
    Dim listSTR As String, foundinlist As Integer
    Dim data_change_request_status As Recordset
    listitems = [Part].ListCount - 1
    currentitems = [Part_name].ListCount - 1

    For listcounter = 0 To listitems
    If [Part].Selected(listcounter) = True Then
    If IsNull([Part_name].RowSource) Then
    listSTR = [Part].Column(0, listcounter) & ";"
    [Part_name].RowSource = listSTR
    foundinlist = False
    For currentcounter = 0 To currentitems
    If [Part_name].Column(0, currentcounter) = _
    [Part].Column(0, listcounter) Then
    foundinlist = True
    End If
    Next currentcounter
    If Not foundinlist Then
    listSTR = [Part_name].RowSource & _
    [Part].Column(0, listcounter) & ";"
    [Part_name].RowSource = ""
    [Part_name].RowSource = listSTR

    End If
    End If
    End If

    End Sub

    I need help urgent. As I said, the items move to the other listbox, but not stored in the table..please help!!


  2. #2
    Join Date
    Feb 2002
    I would think that you should select the items and then append them to the table, requerying the new list to show the new data - rather than appending to the list and expecting the list to update the table.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts