Results 1 to 6 of 6
  1. #1
    SuperSchnauzer is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    May 2013
    Posts
    3

    How to show only specific records based on data chosen in other field.

    I wasn't really sure how to describe this so didn't have much luck googling. Anyway, I'll come up with an example of what I want to do and hopefully it's something easy.

    Let's say I have a form whose table contains information about hundreds of vehicles. I want to categorize these vehicles based on type and model.

    so I have a table "Class" that only contains records like Car, Train, Plane, Boat, etc. Let's call this field "Type"

    Now I have another table for "Vehicle Type" that contains 2 fields - "Type" and "Model".

    It would look a bit like this:

    Type, Model
    Car, widget
    Car, hyundai
    Car, ford
    Boat, widget
    Boat, yacht


    Train, amtrak
    Plane, NYC subway

    On this form I'm working on, I want it so that if a user adds a new record and categorizes it as a "Car", when they choose what Model it is, they are only presented with the choices of Widget, Hyundai, or Ford. If they choose something like "Boat" instead, they still see widget, but now yacht, and no other choices.

    so I think I have to adjust the row source but am not sure if I need to build a query and how I would even input the row source. I don't really have any ideas.


    Does anyone know what I'm talking about.

    Any help would be appreciated! Thanks

  2. #2
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    SuperSchnauzer is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    May 2013
    Posts
    3
    Don't know if I understand either explanantion.

    "One is to have the row source of the second combo refer to
    the first in its criteria
    , then requery the second combo in the After Update
    event of the first. The code would look like this:


    Me.cboCities1 = vbNullString 'to clear the second
    combo

    Me.cboCities1.Requery"


    specifically the bold faced part. Yes, I have two combo boxes, but don't really know where and how to define the critera.

  4. #4
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Did you look at the sample db?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    SuperSchnauzer is offline Novice
    Windows 7 32bit Access 2003
    Join Date
    May 2013
    Posts
    3
    Quote Originally Posted by pbaldy View Post
    Did you look at the sample db?
    missed that...sorry. I'm good now! thanks!

  6. #6
    pbaldy's Avatar
    pbaldy is online now Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,530
    Happy to help!
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 1
    Last Post: 01-23-2013, 10:44 AM
  2. Sub form based on table select specific records
    By ReluctantGeek in forum Forms
    Replies: 0
    Last Post: 01-21-2012, 11:24 AM
  3. Subreport will not show specific data
    By mitchy1111 in forum Reports
    Replies: 1
    Last Post: 05-18-2011, 07:36 AM
  4. Query to show only specific records
    By CEV in forum Queries
    Replies: 5
    Last Post: 03-30-2011, 09:42 AM
  5. Replies: 0
    Last Post: 01-03-2011, 03:38 PM

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