Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008
    Posts
    59

    Unanswered: Creating 'All' Query

    Hi,
    I am trying to create a way that I can add an option to 'Display All' in a combo box. I have found one way to do this using a Join query but am still having problems. The query works by adding an extra field called (All) that should represent all entries in the database, however it only rounds up those entries that are not null. This means I am missing many of my entries. This is the 'Join' query below. If anyone can offer any help on how I can get the (All) entry to actually include all entries as opposed to those that are not null I would be very grateful.

    Code:
    SELECT tbl_Interested.ProgID AS PID, tbl_Interested.Programmes AS Interested
    FROM tbl_Interested
    
    UNION SELECT "*" AS PID, "(All)" AS Interested
    FROM tbl_Interested
    ORDER BY Interested;
    Thanks
    Russ

  2. #2
    Join Date
    May 2005
    Posts
    1,191
    Sounds like you're confusing the listbox's RowSource property; you can either have a Table/Query, or a Value list, but not both. Although it is possible to create a recordset based on a query, run through all the results and create a value list based on a query (in which, you could then add an item like "(All)").

    But I think the more important question is why would you want to? I'm assuming that this combo box is used to build a query? I usually just set it up that if the user doesn't make a selection, it's assumed to be all.

    Alternatively, check out Martin Green's article on listboxes; it might be a better alternative for what you're trying to do (or what you're trying to let your users do).

    If you'd like some more help, perhaps you could fill us in on what you're trying to do with this combobox?
    Me.Geek = True

Posting Permissions

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