Results 1 to 3 of 3
  1. #1
    jkk17 is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2015
    Posts
    1

    Lookup Field in Query based on condition

    Hi



    I have a problem with a lookup in my query. I have 2 tables. First for Products where I have a column for product and release number. Second for solution where I have a solution and products that solution involves plus releases of the products. I want to make lookup field in a solution query,where I will be picking products from products table and thats ok. But what if I want to make another lookup for release, where i will be picking up releases from products table, but i want this field to show only releses available for product picked up earlier???
    Thank for Your help

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    What you're talking about is called a cascading combo box/list box arrangement

    To support this you would want an arrangment like:

    Code:
    tblProduct
    Prod_ID  Prod_Name
    1        Product A
    2        Product B
    
    tblProductVersion
    PV_ID  Prod_ID  Version_Text  Version_Date ---> other version specific information
    1      1        1.0           1/1/2013
    2      1        2.0           1/1/2014
    3      1        2.2           1/1/2015
    So in your first combo box you would be referencing the product table
    IN your second combo box you would be referencing the product version table, with a criteria in the query driving the combo box of [forms]![FORMNAME]![PRODUCTFIELDNAME]

    where FORMNAME would be the actual name of your form, and likewise PRODUCTFIELDNAME would be the name of your first combo box (product list)

    then in the ON EXIT property of the PRODUCT combo box you would have code like

    PRODUCTVERSIONFIELD.requery

  3. #3
    CJ_London is online now VIP
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Marco Condition based off a Query
    By bigbox486 in forum Macros
    Replies: 1
    Last Post: 03-30-2015, 09:02 AM
  2. Add Query Based on if Condition
    By shakeelmscw in forum Queries
    Replies: 17
    Last Post: 01-18-2013, 02:35 AM
  3. Hide field in sub-report based on condition
    By vinsavant in forum Reports
    Replies: 4
    Last Post: 12-16-2012, 10:18 AM
  4. Replies: 4
    Last Post: 02-28-2012, 05:26 PM
  5. Replies: 2
    Last Post: 07-07-2011, 08:25 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums