Results 1 to 7 of 7

Thread: Listbox

  1. #1

    Thread Starter
    Fanatic Member joltremari's Avatar
    Join Date
    Sep 2000
    Location
    Mississippi
    Posts
    674
    I'm getting an error when I try and use the List1.Selected property - "Argument not optional"

    I've used it before. What will cause this?

    Thanks,

    JO

  2. #2
    _______ HeSaidJoe's Avatar
    Join Date
    Jun 1999
    Location
    Canada
    Posts
    3,946

    <?>

    your code = ???
    "A myth is not the succession of individual images,
    but an integerated meaningful entity,
    reflecting a distinct aspect of the real world."

    ___ Adolf Jensen

  3. #3

    Thread Starter
    Fanatic Member joltremari's Avatar
    Join Date
    Sep 2000
    Location
    Mississippi
    Posts
    674
    Oops!

    Private Sub List1_Click()
    Data1.Recordset.Bookmark = List1.Selected
    End Sub


  4. #4
    Addicted Member
    Join Date
    Nov 2000
    Posts
    217
    Try this:

    Dim aBookMark as variant
    aBookMark = data1.recordset.bookmark



    **Add this when you want to go back to that bookmark
    data1.recordset.bookmark = aBookMark

    Also, what your trying, i tried the same code with the datalist, except I used the SelectedItem. adExample.Recordset.Bookmark = datalist.SelectedItem

    try using the text property

    [Edited by mpSmooth on 11-21-2000 at 10:33 AM]

  5. #5

  6. #6

    Thread Starter
    Fanatic Member joltremari's Avatar
    Join Date
    Sep 2000
    Location
    Mississippi
    Posts
    674
    None of this seems to be working for me. Let me give you a little more detail...(im new to databases)
    I have a from with several text boxes, each linked to a field in a database.

    I have a Listbox that populates at form_activate with the contents of a database field:

    While Not Data1.Recordset.EOF
    List1.AddItem Data1.Recordset!Name
    Data1.Recordset.MoveNext
    Wend

    What I am trying to do is when I click on a name in the list box I need it to show that record in the text boxes on my form.


  7. #7
    Addicted Member
    Join Date
    Nov 2000
    Posts
    217
    why not use the datalist box that comes with vb. It's located in the components sections. Nevermind, sorry, I just realized that you are using the standard control. I'll see what I can come up with.

    [Edited by mpSmooth on 11-21-2000 at 11:52 AM]

Posting Permissions

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



Click Here to Expand Forum to Full Width