If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
combo box or list box
Hi all ,
i have 2 text boxes on form. one is for "countries" and other is for "states" , Which i have created my table name as "countriesAndStates" i have given all the country names and it states side by side.. just as below.. country state eg: USA ALASKA USA CALIFORNIA when the user selected INDIA IN THE COUNTRY COMBO BOX ONLY STATES of that particular country should be displayed . what i have to do? |
#2
|
|||
|
|||
combo box or list box
Set up the row source for the second combobox to use the value in the first
combobox. And then in the change event of the Countries combobox, requery the second combobox. So your row source for the States combobox would be SELECT State FROM CountriesAndStates WHERE Country like Nz(Forms![NameOfTheForm]![NameOfCountryCombobox],"*") Your code in the after update event of the CountryCombobox would be Me.NameOfStatesCombobox.Requery. NOTE that this does not work well in a continuous form. Since there is really only one combobox on the continuous form - you just see multiple images of the control. And you would need to requery the States Combobox in the current event of the form in order to see the state values for the current record. There are various ways to handle the situation if you are using a continuous form. John Spencer Access MVP 2002-2005, 2007-2009 The Hilltop Institute University of Maryland Baltimore County sweetummy wrote: Hi all , i have 2 text boxes on form. one is for "countries" and other is for "states" , Which i have created my table name as "countriesAndStates" i have given all the country names and it states side by side.. just as below.. country state eg: USA ALASKA USA CALIFORNIA when the user selected INDIA IN THE COUNTRY COMBO BOX ONLY STATES of that particular country should be displayed . what i have to do? |
#3
|
|||
|
|||
combo box or list box
yes its not working for in a continous form could tell me how to
implement "Lost focus" functionality for this situation... B'cos when i select country and click on the tab immediately 2nd combo box should be displayed the states.. |
#4
|
|||
|
|||
combo box or list box
Check out Doug Steele's February 2006 example database and article.
http://www.accessmvp.com/DJSteele/SmartAccess.html John Spencer Access MVP 2002-2005, 2007-2009 The Hilltop Institute University of Maryland Baltimore County sweetummy wrote: yes its not working for in a continous form could tell me how to implement "Lost focus" functionality for this situation... B'cos when i select country and click on the tab immediately 2nd combo box should be displayed the states.. |
Thread Tools | |
Display Modes | |
|
|