473,379 Members | 1,386 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,379 software developers and data experts.

Populate a ComboBox

Hi,

I have filled a combo box from an access db. Depending on what the user selects I want to fill another combo box with the results.

ie

Combo 1 contains Counties. If the user selects say Yorkshire, all the town in that county appear in the second combo box so the user can select one. The counties and towns are stored in the same db.

County
Town
County_ID

I am sure this is possible but not sure how. vbScript if possible. not done too much javascript.

Any help would be greatly appreciated..


Cheers
PurpleGerbil
Sep 29 '07 #1
3 2053
MikeSA
20
Hi,

I have filled a combo box from an access db. Depending on what the user selects I want to fill another combo box with the results.

ie

Combo 1 contains Counties. If the user selects say Yorkshire, all the town in that county appear in the second combo box so the user can select one. The counties and towns are stored in the same db.

County
Town
County_ID

I am sure this is possible but not sure how. vbScript if possible. not done too much javascript.

Any help would be greatly appreciated..


Cheers
PurpleGerbil
I have the same problem. Looking forward to a reply from someone who knows...
MikeSA
Sep 30 '07 #2
I have the same problem. Looking forward to a reply from someone who knows...
MikeSA
Hi
You can just keep the selected item, from combo1, in a variable say "var1" and using that you can write a query to retrieve the towns column only where the "country = var1", that is the selected country, and just fill the combo box 2.

You just can do it in vbscript.
Hope the idea will work.
Oct 1 '07 #3
jhardman
3,406 Expert 2GB
I have the same problem. Looking forward to a reply from someone who knows...
MikeSA
There are two ways to do this that I have seen on the web. One way is to have a whole bunch of drop down selects (they are called "selects" in HTML) already made but hidden on the page, so that when the user makes the selection in the first select, the second just has to appear. Does that make sense? This is done with javascript or dynamic css and isn't that difficult if you know what you are doing.

The other option is to submit the form when a selection is made, then resend the exact same form to the user (with the previously filled out inputs already filled out) with one more dropdown select. This method is easier if you don't want to mess with javascript and you don't mind that the form will freeze up for a second while the page reloads. Does this make sense?

Either way works, and your choice should be largely dependent on which are you more comfortable with coding.

Jared
Oct 1 '07 #4

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

Similar topics

4
by: godber | last post by:
I need to populate text boxes for instance with employee information using their unique employee works number selected from a combo box. Can anyone help, I am told thru visual basic this can be...
4
by: Marc Jennings | last post by:
Hi there, I'm new to C#, and I have a small problem. I have created a new DataSet using the code below, and I would like to be able to populat a drop-down list with the results of the "name"...
4
by: Mike L | last post by:
I'm open for any suggestions on how to better program this. I want the user to select a license from a combo box, cboPrivilege and then the user will click the add button, then a record will be...
0
by: masterej | last post by:
I'm trying to populate a ComboBox (dropdown style) with strings of text from an ArrayList. The ComboBox is actually being populated with the correct items, however, they appear only as blank...
16
by: agrawal.solutions | last post by:
Hello Friends I am asking a very silly question but i dont find any solution fo this.. I am selectiong a recordset and want to populate a combobox where id would be inviseble and the content...
2
by: rperreta | last post by:
I exported a xml file using .writexml from a dataset and now I would like to populate a combo box from that. Can someone supply a link or sample vb.net code that show's how to do this... much...
5
by: Rich | last post by:
Hello, I have a search application to search data in tables in a database (3 sql server tables). I populate 2 comboboxes with with data from each table. One combobox will contain unique...
4
by: polaris431 | last post by:
All the examples I've seen showing how to populate a combobox using the DataSource property and an ArrayList show the ArrayList object containing objects with at least two properties. I want to...
1
by: freekedoutfish | last post by:
Hi. New member here Im sat at work, pounding my head off the desk because this tiny bit of simple code refuses to work. The sub is intended to pull data from the "companyname" column in the...
0
TonFrere
by: TonFrere | last post by:
Hello, I'm building a windows form application in Visual C# using VS 2005. On my form I need to populate a combobox with Invoices# linked to the current reccord's Order# value. This means that: -...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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: 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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.