Filter a form via a set of comboboxes on a seperate search form

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • LeighW
    New Member
    • May 2012
    • 73

    Filter a form via a set of comboboxes on a seperate search form

    Hi all,

    This one is way to complex for me to work out.
    Presently I have a search form (frm_Search) which is accessible via the Switchboard. I want to be able to search for records within frm_Argument.

    I've created a many-to-many relationship between tbl_Argument and fields; fld_Structure, fld_System, fld_Component, fld_Substance which are based on their respected tables. I adjust how the fields and arguments from frm_Argument are linked via a junction table/form.

    I want to be able to search using the fields above on frm_Search using comboboxes to filter frm_Argument to the records which are joint to each particular field.

    The problem is that the fields can only be shown within a sub-form on frm_Argument because they are not within tbl_Argument (unless I can create a bound lookup somehow?). It means that it will be difficult to filter the form from a seperate form unless you can link to the subform?

    Once that has been worked out I'd also like to be able to select the 4 fields (based on seperate comboboxes) on frm_Search to filter the records down as much as possible rather than just using one combobox. Also on frm_Search I'd want to use a command button once the combobox items have been selected to open frm_Argument with the filtered results.

    I have no idea where to start.

    Thank you for any assistance and I'm sorry if this isn't obvious enough,

    Leigh
  • zmbd
    Recognized Expert Moderator Expert
    • Mar 2012
    • 5501

    #2
    Leigh,
    That's hard to see what you have going on in my mind's eye...

    However, start with this:http://bytes.com/topic/access/insigh...filtering-form I think that you can do this without too much trouble; however, we may need to take a peek under the hood in a post or two :)

    (you'll also want to take a look at the links at the bottom of that link as it will answer part two of your question)
    -z

    Comment

    • LeighW
      New Member
      • May 2012
      • 73

      #3
      I forgot about that link! I'll give it a good read tomorrow.

      Cheers Z

      Comment

      • LeighW
        New Member
        • May 2012
        • 73

        #4
        OK the examples by NeoPa will not work in my case as the search form is working seperately to the main form.

        It is also gathering data from a subform to filter the main form which NeoPa's method doesn't address.

        I followed Allen Browne's method for filtering the main form based on a field in a subform:

        How to filter a form in a Microsoft Access database, based on a field that is not in the table the field is bound to.


        This works perfectly on the main form. I now want to move that method to the search form somehow rather than clogging up the main form with searches.

        I've managed to recreate the same method on the search form by binding the search form to tbk_Argument (the same table the main form is bound to) and putting in a hidden copy of the subform. However I'm not sure how to open up the main form with the same filter?

        When I open the main form using a command button, once the filter is set in the search form, it will open up all records with no filter or if I set the WHERE criteria to the ID field it will open up just one record not the entire filtered list.

        I've seen that there are methods of opening reports using the same filter as the calling form I'm wondering if it's possible with other forms.

        Feels like I'm close but still far...

        Comment

        Working...