Results 1 to 4 of 4

change a combobox value depending on another

  1. #1
    emadaldin is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    2

    change a combobox value depending on another

    hey guys ,


    i'm new to access so don't laugh on my problem.
    hope u can help me with it.

    simplified:
    table 1 name : city
    first column : cityid (number) and it's the primary key
    second column : cityname (Text)
    and fields on it US, UK, JP

    table 2 name : area
    first column : areaid (number ) and it's the primary key
    second column : area name (Text)
    and fields on it > California, London, Tokyo


    i made a forum with 2 combo boxes first is ( city ) and second is ( area )

    what i need is : when i choose US from the first combo box
    it shows only California in the second combobox
    and when i choose UK it shows only london
    and so on ..
    i'll upload my file . hope u guys help a newbie here .




    --- edit --- just a thought . made an cityid column in the area table and used query to link it ... but still it shows only 1 specific area for all the city i have .....

  2. #2
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    Welcome to the forum!

    Shouldn't your first table be countries not cities?

    tblCountry
    -pkCountryID primary key, autonumber
    -txtCountryName

    I also assume that US, UK and JP are records in the table not fields.

    tblArea
    -pkAreaID primary key, autonumber
    -fkCountryID foreign key to tblCountry
    -txtAreaName

    Again I assume that California, London, Tokyo are records in the area table.

    Regarding your form, you are describing a concept known as cascading combo boxes where the choice in the first combo box filters what the user sees in the second combo box. There are many examples of this on the web. Here is a link to one such site that has an example database that should help.

  3. #3
    emadaldin is offline Novice
    Windows 7 32bit Access 2010 32bit
    Join Date
    Jan 2011
    Posts
    2
    Well , u just understand what i want and Gave me the best example i needed
    Thanks Very much now it's working perfect .

  4. #4
    jzwp11 is offline VIP
    Windows 7 Access 2007
    Join Date
    Jun 2010
    Location
    Dayton, OH
    Posts
    2,901
    You are welcome! Glad to help out.

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

Similar Threads

  1. Replies: 0
    Last Post: 08-24-2010, 06:38 PM
  2. Open Report or Form depending on condition
    By jheintz57 in forum Forms
    Replies: 5
    Last Post: 03-12-2010, 08:16 PM
  3. Return blank field depending on quantity
    By anthonyjf in forum Access
    Replies: 1
    Last Post: 04-01-2009, 08:22 AM
  4. Replies: 1
    Last Post: 03-18-2009, 12:30 AM
  5. Replies: 0
    Last Post: 03-16-2006, 04:59 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
  •  
Tech Forums: Microsoft Office Forums