Search for records based on category chosen in combo box

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Weat

    Search for records based on category chosen in combo box

    I have set up a combo box that has categories eg finance, legal etc. How do I get it to work, so that when a person chooses one of the values in the combo box, a table or form opens to show only the records that come under that category?
  • beacon
    Contributor
    • Aug 2007
    • 579

    #2
    You will add an AfterUpdate() event to the combo box in VBA that calls the form using the DoCmd.OpenForm method and sends a filter to the form.

    Here's an example (although it updates a subform, the same theory applies, just do a search on the DoCmd.OpenForm and how to pass a filter and you'll be in good shape): http://www.techonthenet.com/access/f...ilter_form.php

    Comment

    • weat

      #3
      Maybe it's the filter I am having problems with.

      How do I specify a filter in the query to pull up records based on the combo selection?

      PS I don't really want a subform, just the combo selection (which is in a switchboard) to open the table only with the filtered results.

      I've trawled the web, and can't find this anywhere simply explained. I have tried writing =Forms![YourForm]![YourcOMBObOX]and other variants on this, in the query table, but then I just get a parameter box with this double dutch in the label.

      Comment

      • Mr Key
        New Member
        • Aug 2010
        • 132

        #4
        Open this attachment below, may be this is what you are looking for.
        In this attachment you will just open a records based on Combobox.
        Should you have any doubts, dont hesitate to ask
        Attached Files

        Comment

        • Mr Key
          New Member
          • Aug 2010
          • 132

          #5
          If that post wont answer your question, try this new one, in this you can decide to open report or query
          Attached Files
          Last edited by Mr Key; Oct 3 '10, 04:42 PM. Reason: Updating records for better understanding

          Comment

          • aditngr
            New Member
            • Feb 2012
            • 1

            #6
            Hey Mr Key, thank you for your post, it helps me somehow. However, ** Snip **.
            Last edited by NeoPa; Feb 27 '12, 03:38 PM. Reason: Hijack part of post removed.

            Comment

            Working...