Results 1 to 6 of 6
  1. #1
    Join Date
    Feb 2005
    Posts
    29

    Unanswered: subform and combo box. (Combo box to show all data)

    Hi all this is newbie qoo again asking for direction. Hope all expertise hwere kindly give your opinion.
    I have a combo box that have value from a table which filter out those row i wanted to see on a subform that reference to a table.

    Basically i have the same id on both table thus when user select the combo box the subform will only display the row that contain the id selected (the table have duplicate id). I use the link master and child field to create the linkup and filter the process. It work well as what i wanted. But now the problem is i would like to see all records from the table without filtering. So how to create the same combo box with a all catergory that i can reference to show all data in the subform?? any suggesion?....i have read all other post related but it maybe i don't understand all there isn't any thread that do similar thing...so kindly anybody they could help?

    Thanks in advance.

  2. #2
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    I generally do not use the master and child option to populate subform data. Instead, set the recordsource of the subform such that it references some parameter when required.

    Eg,

    No Restriction: "SELECT * FROM tableA"

    Restriction: "SELECT * FROM TABLEA WHERE ID = " & Parameter
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

  3. #3
    Join Date
    Feb 2005
    Posts
    29
    can that be link to the combo box? sorry generally new to access so do not know what to do with it.

  4. #4
    Join Date
    Feb 2005
    Posts
    29
    Hi all i found some one writing this like below:

    WHERE [Table].[Colomn]=[Forms]![formname]![ComboboxName]
    Or [Forms]![formname]![ComboboxName]="ALL"

    in a form on a query and then puttinh these code in the combo bos source

    SELECT Status
    FROM yourtable

    Change it into

    SELECT Status
    FROM yourtable
    UNION
    SELECT "ALL"
    FROM yourtable

    ..i tried but same thing it result the filtered record but not the "all record" when i select the "All" in the combo box.......any kind soul can help me??

  5. #5
    Join Date
    Feb 2005
    Location
    The Hague, Netherlands
    Posts
    95
    "SELECT * FROM yourtable" ?

    * represents "all" records, as it would in f.i. a search in Windows Explorer and you were searching for all word-documents, you would type in the search-box: *.doc

    Or is that not what you are looking for?

  6. #6
    Join Date
    Sep 2003
    Location
    The extremely Royal borough of Kensington, London
    Posts
    778
    Aside: Do not use UNION when you know the records will always be distinct. Instead, use UNION ALL.
    Bessie Braddock: Winston, you are drunk!
    Churchill: And Madam, you are ugly. And tomorrow, I'll be sober, and you will still be ugly.

Posting Permissions

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