Results 1 to 3 of 3
  1. #1
    stotts04 is offline Novice
    Windows 7 32bit Access 2013
    Join Date
    Feb 2014
    Posts
    1

    Text box that pulls values based on 2 dropdowns

    I am looking to create a textbox that would pull information based on what is selected in 2 dropdown boxes.



    For example:

    I would have a table that looks like this:

    Column1 Column2 Column3
    Hat small 5 dollars
    Gloves medium 7 dollars
    Pants large 10 dollars
    Shirts 12 dollars
    15 dollars

    dropdown 1 would select from Column1
    Dropdown 2 would select from column2

    The textbox would depend on what is selected from what is selected in both dropdowns.

    Say they select Hat and Small. The textbox would return 5 dollars.

    Does anyone know how i would setup the textbox to pull that information?

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,726
    So your table has 3 fields
    Item
    Size
    Cost


    Concept is:
    First Combo (Rowsource)
    Select Distinct Item From MyTable

    Second combo(Rowsource)
    Select Size from MyTable WHERE Item = Combo1

    There is a great tutorial at Datapig Comboboxes

  3. #3
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Have dropdown 2 include Column2 (Size) and Column3 (Price) - a multi-column combobox.

    The textbox ControlSource can be an expression that references Price column by index:

    =[comboboxname].Column(1)

    Column index begins with 0 so Price column is index 1.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 1
    Last Post: 10-16-2013, 07:57 PM
  2. Replies: 2
    Last Post: 11-12-2012, 03:52 AM
  3. Replies: 2
    Last Post: 05-16-2012, 04:45 PM
  4. Replies: 10
    Last Post: 07-02-2011, 11:51 AM
  5. Replies: 1
    Last Post: 03-27-2010, 06:13 AM

Tags for this Thread

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