Results 1 to 2 of 2

Thread: Form VB Help

  1. #1
    Join Date
    Apr 2004

    Unanswered: Form VB Help

    I have created a list box in a form. I a using the multi select property set at extended. When more than one field is selected, I need it to bring all the selected items in the list into the table. It currently is only bringing the first item in the list in if it is selected. If it is not selected, but other items are it isn't bringing anything into the table. How can I get this to work properly. I am still new to writing VB so please make this as easy as possible for me to understand. Thanks.

  2. #2
    Join Date
    Mar 2003
    The Bottom of The Barrel
    Provided Answers: 1
    You could try something similar to this:
    For i = 0 To ListBox.ListCount - 1
       If ListBox.Selected(i) Then
          'whatever code you're using to dump the record into the table
       End If
    Next i
    Or you could go the variant route:

    For Each var in ListBox.SelectedItems
       'whatever code you want here
    Next var
    oh yeah... documentation... I have heard of that.

    *** What Do You Want In The MS Access Forum? ***

Posting Permissions

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