Results 1 to 6 of 6
  1. #1
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168

    Cannot get Listbox to display records

    I think this may be in the wrong category .. but I have changed my game plan.



    I have a "Query Switchboard" form .. with command buttons on it to run appropriate queries.

    I was going to just display the results in Datasheet view .. but couldn't get it to work.

    So .. I am thinking I would just like to fill a listbox with the query results from each query.

    I have the following .. on click of my command button. But I get no results. My form is a popup form .. if that makes any difference.

    Me!lstResults.RowSource = "SELECT Transmissions.Id, Transmissions.TransDate, Transmissions.TransTime, Transmissions.Radio, Transmissions.Type, Transmissions.TransType, Transmissions.Group FROM Transmissions WHERE (((Transmissions.Radio)=[]));"
    Me!lstResults.Requery

    I would like to have this listbox display the results from several queries just by changing the rowsource property .. is this possible or am I just confused on this.

    I do not want to create forms for each of these queries .. just a quick display of the resulting data.

    Thanks
    - Kevin -
    Last edited by edmscan; 07-22-2014 at 12:19 PM. Reason: Changed contents

  2. #2
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    It sounds as if the popup property of the form is set to "Yes" (I was able to get the same thing - the form stayed on top). See if changing it back to "No" resolves that problem.

    John

  3. #3
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    I am confused all to ***** ... I just made a simple form with a listbox and changed the RowSource and requeried and it works just fine. Consider this a work in progress .. and I think I will be fine. Give me a few minutes before I mark this as solved.

  4. #4
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Quote Originally Posted by John_G View Post
    Hi -

    It sounds as if the popup property of the form is set to "Yes" (I was able to get the same thing - the form stayed on top). See if changing it back to "No" resolves that problem.

    John
    Thanks .. it is weird and yes I think that has to do with the problem. But I seem to have something working now. I will give it some more effort and see what works.

  5. #5
    John_G is offline VIP
    Windows 7 32bit Access 2010 32bit
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    (New Version!)

    Changing the rowsource of the listbox should work. If you are getting no results, it may mean that the SQL Where clause is not selecting any records to display. The example you show above doesn't look right - what do those empty square brackets ([]) mean?

    John

  6. #6
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    I found the issue .. it did not like that it was wanting to prompt for a parameter ie [] .. which works in a query but not like I was doing it.

    EDIT .. re your ? the [] will prompt you in a query for a value .. but will not work in a form for example .. as a rowsource. I don't normally use that except in queries, and know now that it will only work there.

    So .. I just used a text box to get my criteria and it works just fine.

    Thanks ..

Please reply to this thread with any new information or opinions.

Similar Threads

  1. DoCmd.OpenQuery with Parameters?
    By mwhcrew in forum Queries
    Replies: 5
    Last Post: 10-10-2014, 01:49 AM
  2. Expand Button in Datasheet View Doesn't show related table
    By CementCarver in forum Database Design
    Replies: 5
    Last Post: 07-17-2013, 11:48 AM
  3. Replies: 2
    Last Post: 03-25-2013, 09:10 AM
  4. Replies: 3
    Last Post: 12-07-2012, 04:26 PM
  5. Replies: 6
    Last Post: 11-21-2012, 05:10 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums