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.

Access - restricting lookup choices

Discussion in 'Business Applications' started by simonelliott, Oct 9, 2007.

Thread Status:
Not open for further replies.
  1. simonelliott

    simonelliott Thread Starter

    Joined:
    Jul 27, 2006
    Messages:
    18
    Hiya
    Complete access novice here. I've attached the beginnings of my inventory DB. When using the Stock Items form, once i've chosen from the drop-down menu under Stock Categories, i'd like the next drop-down menu (StockSubCategories) to be restrited to the list shown in the Stock Sub-Categories table. IE, once i've chosen "Kitchen Supplies", i would not like to see "Fuel" as a possible Sub-category.
    I'm too clueless, so any help appreciated.
    Thanks
     

    Attached Files:

  2. Ziggy1

    Ziggy1

    Joined:
    Jun 17, 2002
    Messages:
    2,551
    take a look at the attached, first I made a query from the "Stock Sub-Categories" table.

    Second I placed criteria in the query under field Stock Categories like this...

    [Forms]![Stock Items]![StockCategories]

    this refers to the Combo on the form, and serves as criteria to the Combo you want to restrict (StockSubCategories).

    the next step uses VBA in the "After Update property" on the "STOCKCategories" combo on the form.

    Private Sub StockCategories_AfterUpdate()
    Me.StockSubCategories.Requery
    End Sub

    what it does is, when you make a choice it will requery the source of combo "StockSubCategories".

    *Note that I changed the source of this combo to point to the query I made. Compare the changes to understand how it works.
     

    Attached Files:

  3. OBP

    OBP Trusted Advisor

    Joined:
    Mar 8, 2005
    Messages:
    19,694
    Ziggy (y) :)
     
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/635738

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice