473,387 Members | 1,863 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

using combo list

I'm trying to create a form that has States and it's local governments, such that when I select a state in a combo list, then in the next combo list, all it's local governments are displayed so I can select which particular local government I want.
Jun 10 '10 #1
2 1316
jimatqsi
1,271 Expert 1GB
Here's some code where I change the rowsource of two combo boxes which are asking for a from/to range of sales territories.

Expand|Select|Wrap|Line Numbers
  1.         ' territory
  2.         strSQL = "Select tblAPSalesRep.strSalesRepID from tblAPSalesRep  WHERE (((tblAPSalesRep.strSalesRepID)<>'SR01')) "
  3.         Me!cboFrom2.RowSource = strSQL
  4.         Me!cboThrough2.RowSource = strSQL
  5.  

You can change the rowsource of your second combo box after an entry is made in the first combo box by the user. The SQL query you create will use the first combo box to supply part of the criteria.

Jim
Jun 10 '10 #2
NeoPa
32,556 Expert Mod 16PB
Check out Cascading Combo/List Boxes.
Jun 10 '10 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Cillies | last post by:
Hi! I have a form that displays information using DLookUp. Now at present I am going into the query and entering criteria that I want the form to display. i.e. the form is for a sports team and...
1
by: Cillies | last post by:
Does any one know if it is possible to search a database by using combo boxes from a form. I have a form which includes comboboxes. I want to know If I can use these combo boxes to search, i.e....
1
by: bbcdancer | last post by:
Is it possible to restrict the length of a text box in MS Access using VBA on condition to what is selected in a list combo box. Scenario: 1. I have a list combo box containing: AA BBB...
5
by: sensreview | last post by:
Hello, I need help in selecting a value from combo list thru one lookup table and update different table on MS access form. For eg; I have a lookup table of usernames, I need to use this...
4
Rabbit
by: Rabbit | last post by:
Cascading Combo/List Boxes This tutorial is to guide you in the creation of Cascading combo/list boxes. That is when you have multiple combo/list boxes where the selection of an option in one...
6
by: Rotor | last post by:
Hello again, In Access 2k3, I need for the combo list to auto expand when the user tabs into the field, or click on the field. I saw that there is a DropDown command, is that correct? Just typed...
26
by: pouj | last post by:
Hey i need help with setting up this on ACCESS 2007 i need step by step i need a form... i select a name (drop list)...then gives me more choice (in next drop list) ....then when i select that...
1
by: jyotig | last post by:
hi, i am using combo box for company list in ms-access but if new company name will come that time i am going to table and add new company and again open form and select that company. there is...
4
by: =?Utf-8?B?R3JlZw==?= | last post by:
Can someone give me e simple example of to populate a combo box / list box using an ArrayList? THanks.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.