-
February 11th, 2004, 07:26 PM
#1
populating combo boxes
Hi
i have 2 combo boxes 1 named cmbtown the other cmbmovies.
i also have a table named town and a seperate table for each town (e.g. manchester, london ) which has all the movies listed. i have a data control linked to the table town and 1 linked to each of the the other tables.
i am trying to get it so when i select a town (e.g. manchester) in combo1, combo2 lists all the movies available in that town.
if anyone can help plz post up.
cheers
jamie
Jamie
E-mail - zen17120@zen.co.uk
Msn - finland11@hotmail.com
Fastpay - Zen17120@zen.co.uk
-
February 11th, 2004, 09:55 PM
#2
Which is the control, Data Access Object or ADO Data Control?
I would suggest another structure of tables:
I table called Towns, with all the towns, having two fields: Town_ID and Town_Name
I table called Movies, having 2 fields: Movie_ID and Movie_Name
Then a third table, Relations, having 2 fields:
Town_ID and Movie_ID.
For example:
London has Rocky 1 and Rocky 2
In table Towns, London's ID is 12
In table Movies, Rocky 1's ID is 3 and Rocky 2's ID is 4
Then in table Relations, you have:
Town_ID Movie_ID
12 3
12 4
In VB, you use your data objects to populate combos. If you don't know how to do this, tell us which control you use and we'll help you.
Bye !
-
February 11th, 2004, 10:49 PM
#3
Yeah I agree with vbUserName for the redesigning of the database.. If you are going to use the ADO data access, a close open connection object will do just fine.. It seems to me that the combo1 (town) will be loaded with the records once, and the combo2(movies) will eventually be loaded with records in respond to the Click event of combo1..
Busy
-
February 12th, 2004, 08:07 AM
#4
You could use a list view instead of the second combobox (with the movies) to present the result of the user's clicking of the first combobox (with the towns) ...
Good luck!
B. Mileva
-
February 12th, 2004, 06:32 PM
#5
Hi
The controls are Data Access Object.
ill just re design my Database now.
cheers
Jamie
Jamie
E-mail - zen17120@zen.co.uk
Msn - finland11@hotmail.com
Fastpay - Zen17120@zen.co.uk
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|