Results 1 to 3 of 3
  1. #1
    Asma is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    11

    Unhappy Set the value of dropdown list based on a listbox selection

    Hi,

    I have a listbox for countries and dropdown list for regions. I want to set the region based on the country selection.



    eg. If China is slected from listbox i want region to be set to Asia automatically. I'm using Microsoft visual basic.

    plzzzzzzzzz help
    any idea's

  2. #2
    NTC is offline VIP
    Windows Vista Access 2007
    Join Date
    Nov 2009
    Posts
    2,392
    In Access there is more than one way to solve it. One approach is to have a 2 column city table so that the region value is in the column next to the city value. One needs this fundamentally no matter how you solve the problem. Thus when one selects city, they are also defacto selecting the region. To make the region value display - make an unbound textbox with a value something like this:
    =me.citycombobox.column(2)

    You can control the visibility of the region value in the city combobox choice by manipulating the width of its column to either make it visible or not visible inside the city selection itself.

    if you want that region value bound - instead of using an unbound text box to display it; instead - use a bit of vb in the AfterUpdate event of the city combobox to push it into a bound text box i.e. me.BoundTextBox=me.citycombobox.column(2)

    hope this helps.

  3. #3
    Asma is offline Novice
    Windows Vista Access 2007
    Join Date
    Aug 2010
    Posts
    11

    Smile Solved :D

    Thanks NTC

    I did it using Select statement

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

Similar Threads

  1. Replies: 3
    Last Post: 08-03-2010, 03:35 AM
  2. Set up a dropdown List
    By asherbear in forum Access
    Replies: 2
    Last Post: 06-24-2010, 06:45 AM
  3. Dropdown list in a query
    By asherbear in forum Queries
    Replies: 6
    Last Post: 05-31-2010, 06:38 PM
  4. Cancel listbox selection
    By vba-dev in forum Access
    Replies: 0
    Last Post: 10-26-2009, 12:18 PM
  5. adding list to a listbox
    By jetrow in forum Access
    Replies: 0
    Last Post: 08-15-2006, 03:36 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