Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 526987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T08:50:05+00:00 2026-05-13T08:50:05+00:00

i am a vb.net programmer, and i have done lots of VBA with excel.

  • 0

i am a vb.net programmer, and i have done lots of VBA with excel. i am a beginner at access.

someone has given me an access database to debug and i am lost.

i succesfully made it connect to a local mysql database.

i have a listbox on a form that has a rowsource attached to a query called listbox. here’s a picture of the properties of the listbox:
alt text http://img192.imageshack.us/img192/936/listboxotherrelationsls.png

there are some issues with displaying the results of the query because the query is too complex and incorrectly structured. when there are fewer than a few results from the query, they display in the listbox without a problem, but when there are more than 4-5 results, it leaves it blank; however, i know that it returned the correct number because it left the correct number of rows (which are blank in the listbox). therefore, instead of trying to fix the huge messy query, i would like to feed all the rows in a string, and then feed them back into the listbox.

can someone help me with this? when you reply please put your responses in laymen’s terms because as i said i am an access beginner.

this is what the listbox looks like when it doesnt want to display results:
alt text http://img43.imageshack.us/img43/4632/fullscreencapture122220.jpg

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T08:50:06+00:00Added an answer on May 13, 2026 at 8:50 am

    You could try something on these lines:

    ''Some notes on declarations for ADO recpdset and connection
    Dim rs As New ADODB.Recordset
    Dim cn As New ADODB.Connection
    
    ''Set the connection object to the access project
    ''connection. You may wish to use a connection string (see below)
    Set cn = CurrentProject.Connection
    
    ''Open the recordset, change the sql string to whatever string is used
    ''to populate the listbox
    rs.Open "SELECT * FROM Testaccess", cn
    
    ''Convert the recordset to a string delimited by row and column with ;
    ''This is the delimiter needed by Access for the listbox with value data
    strlist = rs.GetString(, , ";", ";")
    
    ''Set the rowsource of the listbox to the string
    Me.List0.RowSource = strlist
    
    ''It would be easiest to set these before the run
    ''None of this is necessary, it can all be set as properties 
    ''of the listbox before the code is run
    ''Column count, same as number of fields
    Me.List0.ColumnCount = rs.Fields.Count
    ''List type is values
    Me.List0.RowSourceType = "Value List"
    
    ''This is just a set of 1cms for each column
    For i = 1 To rs.Fields.Count
        strWidths = strWidths & ";1cm"
    Next
    
    ''here we go, all columns set to 1cm width
    Me.List0.ColumnWidths = Mid(strWidths, 2)
    

    connection string: http://www.connectionstrings.com/

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am a vb.net programmer switching to C#. I have the following code for
I am a C# programmer but I have to work with some VB.Net code
I am a PHP programmer. I have no .Net coding experience (last seen it
I am a newly graduated programmer. I have done many web pages and services
i'm ASP.NET programmer and have no experience in creating windows services. Service i need
I have a webservice programmed in coldfusion which I'm attempting to consume using c#.net.
I am a .NET programmer who needs to port one good Desktop OTP system
I'm a .NET programmer doing some Hadoop work in Java and I'm kind of
I am a lone programmer working on many .Net projects. I work alone and
I am a C# programmer but dabbling in VB.Net because everybody else in my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.