+ Reply to Thread
Results 1 to 3 of 3

Problem Adding Rows to ListBox from Recordset

  1. #1
    Registered User
    Join Date
    08-22-2008
    Location
    UK
    Posts
    13

    Problem Adding Rows to ListBox from Recordset

    I have created a variant array that recieves data from a recordset using the GetRows() method of the recordset and then I am assigning the array to the .List property of the ListBox, as follows:

    Please Login or Register  to view this content.
    The problem I have is that if there is only one record in the recordset the ListBox is displayed empty, however if I add another record to the database both records are displayed in the ListBox?

    As you can see, I've tried using the Transpose function as well as just assigning the array directly but the problem exists using either approach.

  2. #2
    Forum Guru romperstomper's Avatar
    Join Date
    11-04-2008
    Location
    A1
    MS-Off Ver
    Most
    Posts
    12,302

    Re: Problem Adding Rows to ListBox from Recordset

    Your problem is that the list actually ends up showing each field in the record as a new line in the listbox. Since the first column has zero width, you can't see anything. See this post for a workaround.
    Remember what the dormouse said
    Feed your head

  3. #3
    Registered User
    Join Date
    08-22-2008
    Location
    UK
    Posts
    13

    Re: Problem Adding Rows to ListBox from Recordset

    romperstomper, thanks for your reply, I've implemented that function and it works perfectly.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1