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 - Lookup Based On Previous Field Result?

Discussion in 'Business Applications' started by ittrain, Jul 22, 2006.

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

    ittrain Thread Starter

    Joined:
    Jul 1, 2005
    Messages:
    37
    I have a table that has service information which is categorised as ServiceType, ServiceDescription, ServiceCode, etc. The are up to 200 unique ServiceDescription/ServiceCode enrties per ServiceType.

    I am trying to create table for orders that will only allow ServiceType from a listbox. I then need service description to be listed as a listbox based on the selection made from service type. I then need the ServiceCode to show based on previous 2 selections. :eek:

    --EG--

    ServiceType ServiceDescription ServiceCode
    Cleaning Clean Dwelling 001
    Skips Empty Skip 002
    Skips Replace Skip 003
    Skips Remove Skip 004
    Scaffold Erect New 005

    So if I select Scaffold from drop down, it only shows Erect New in drop down for description and once that is selected, 005 is autofilled for Code
     
  2. OBP

    OBP

    Joined:
    Mar 8, 2005
    Messages:
    19,889
    This is fairly easy to achieve. The easiest is with the queries supplying your 2nd & 3rd Combos.
    Asuming that your ServiceDescription Table contains the ServiceType ID
    and the ServiceCode Table contains the ServiceDescription ID.
    Create a query for your ServiceDescription including the ServiceType ID.
    Create a query for your ServiceCode including the ServiceDescription ID.
    In the first combo Afterupdate event procedure requery the 2nd Combo.
    In the 2nd combo Afterupdate event procedure requery the 3rd Combo.
    The key to make it work is to enter in to the 2nd combo's query's Criteria row for the
    ServiceType ID - forms![fromname]![combo().column(1)]
    where the second column of the 1st combo is the ServiceType ID.
    Repeat this for the 3rd combo and the ServiceDescription ID.
     
  3. ittrain

    ittrain Thread Starter

    Joined:
    Jul 1, 2005
    Messages:
    37
    Fantastic, thank you very much... Oh so so much to learn.(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/485383

  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