Results 1 to 2 of 2

Thread: Populate DataListBox with Recorset [VB6]

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2003
    Posts
    308

    Question Populate DataListBox with Recorset [VB6]

    Given a form [Form1] with a DataListBox [dlBox] and a Recordset containing a list of names [oRecs].

    I am trying to display the list of Names in the Recordset in the DataListBox.
    Currently my code is:
    Set dlCust.DataSource = oRecs
    dlCust.ListField = oRecs(0).Name
    However this provides me with an empty DataListBox.

    Any clues as to what I am doing wrong?
    This is how I populate my DataComboboxes which works fine.

  2. #2

    Thread Starter
    Hyperactive Member
    Join Date
    Apr 2003
    Posts
    308
    Or using a normal ListBox (I think this is better, DataListBoxes don't seem to support Multiple Select [which is something I really need]).

    Code:
    Set lbCust.DataSource = oRecs

    That isn't enough, the ListBox (lbCust) stays empty

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