1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Solved: Access 2010 Search

Discussion in 'Business Applications' started by Butterfly807, Jun 15, 2012.

Thread Status:
Not open for further replies.
Advertisement
  1. Butterfly807

    Butterfly807 Thread Starter

    Joined:
    Jun 15, 2012
    Messages:
    70
    Lol! I was just going to tell you that I figured it out by going off what you already told me. You already gave me the answer.

    You've been so helpful! Just want to say..
     
  2. Butterfly807

    Butterfly807 Thread Starter

    Joined:
    Jun 15, 2012
    Messages:
    70
    Is it possible to link multiple subforms in a mainform? For example, what I would like to do is have a Product/Service Search Form. It would work this way:
    1. User would select a product/service category such as "Gasket"
    2. User would then select the type of gasket such as "Garlock"
    3. User then receives list of suppliers that provide Garlock Gasket

    I'm having difficulty setting it up where I select Gasket, and then in a second combo box appears only the type of gaskets, to then produce a result of suppliers.

    Does this make sense?
     
  3. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    The simplest way is to Filter the second Combo based on the selection of the first combo, this is achieved using the second combo box's SQL (query) Row Source.
    You use the the Criteria
    Forms![Formname]![firstcomboname]
     
  4. Butterfly807

    Butterfly807 Thread Starter

    Joined:
    Jun 15, 2012
    Messages:
    70
    I've set it up the way you've described, but my second combo box is coming up blank.
     
  5. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    The second part is to use VBA in the first Combo's After Update event procedure to requery the second combo with
    me.secondcomboname.requery
     
  6. Butterfly807

    Butterfly807 Thread Starter

    Joined:
    Jun 15, 2012
    Messages:
    70
    I'm not understanding...
     
  7. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    Do you know how to open the Combo's After Update Event Procedure?
     
  8. Butterfly807

    Butterfly807 Thread Starter

    Joined:
    Jun 15, 2012
    Messages:
    70
    I know how to open a combo to edit after I've created them. I'm not sure what you mean by 'After Update Event Procedure' though.
     
  9. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    OK, in the Properties go to the Event Tab and the After Update event is the 3rd one down. Click on it and select "Event Procedure" and then click on the 3 small dot builder on the right, it will take you to the VBA Editor at the correct event.
     
  10. Butterfly807

    Butterfly807 Thread Starter

    Joined:
    Jun 15, 2012
    Messages:
    70
    Ok, I've found that. I'm not sure what I do once in the After Update. If I select Requery, I don't know how to proceed. Sorry for all the questions.
     
  11. Butterfly807

    Butterfly807 Thread Starter

    Joined:
    Jun 15, 2012
    Messages:
    70
    .. And is there a way to prevent duplicates? For example, in my first combo, 'gasket' is listed about 10 times because there are 10 different possible gaskets. I want it to only be listed once.
     
  12. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    You should add Grouping to the first combo SQL (Query).

    Once you are in the after update event you can type in

    me.

    the VBA editor will now list the controls available, go down the list and find your second combo and select it then type another

    .r

    and it will list what you can do with the combo starting with an r, go down the list and select requery.
    Then click save.
     
  13. Butterfly807

    Butterfly807 Thread Starter

    Joined:
    Jun 15, 2012
    Messages:
    70
    I know I'm going to drive you crazy today. How do I add Grouping?
     
  14. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    18,834
    If the Ribbon is the same as 2007 you use the "Totals" at the right hand end when in design view.
     
  15. Butterfly807

    Butterfly807 Thread Starter

    Joined:
    Jun 15, 2012
    Messages:
    70
    I am in 2010. I do not see anything that says "totals"
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Loading...
Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/1057216