Two Combo Boxes in a Form (1 Viewer)

phool4fool

Registered User.
Local time
Today, 10:06
Joined
Dec 10, 2011
Messages
34
I really need help, below are the tables:

tblCity
City 1
City 2

tblSchools
SCL-NY-01
SCL-NY-02
SCL-MI-01
SCL-MI-02
SCL-MI-03

tblStudents
StudentName
StudentAge (etc.)

and I want the following result:
I want to create a form for data entry purpose. Where, When the user Select City 1 from 1st Combo box, the 2nd Combo box only shows the SCL-NY-01 & SCL-02 which are the School Codes & then it shows all information about the students in that school. And when a user select City 2, it should show SCL-MI-01, SCL-MI-02, SCL-MI-03 & then the student information like Student Name, Student Age, & so when (fields in tblStudents)
 

phool4fool

Registered User.
Local time
Today, 10:06
Joined
Dec 10, 2011
Messages
34
I've visited this link few hours before but I totally didn't understand this.
Yeah same kind of result but I want that "when a user select city from 1st combo box, the 2nd combo box shows related schools & when user select a specific school from the 2nd combo box, it display all the information (fields in tbl schools) about that particular school.

Please also guide me because I'm not picking up that example.
 

phool4fool

Registered User.
Local time
Today, 10:06
Joined
Dec 10, 2011
Messages
34
I'm unable to upload database file, so may be i'm unable to describe my problem.
I try again to describe what problem i'm facing.
I've many schools in different cities & each schools has it's unique code.
in my database I've created following tables

tblSchool
SchoolCode >>>> SCL-NY-01 (Text field)
SchoolAddress >>>> adress (Text field)
City_ID>>>>Lookup Column (data comes from tblCity)

tblCity
ID >>>> Autonumber
City >>>> City Name (Text field)

tblStudent
ID>>>> Autonumber
StudentName>>> (Text field)
StudentAge>>>>
StudentClass>>>>
many more fields like attendances, grades etc.

tblStudent is linked with tblSchool in One-To-Many relationship.

Now I'm creating a form from tblSchool & in that form, there is a sub-form (which is automatically created) which shows information about Students in that School. As there are many Schools & each has a unique School Code so I created Combo Box from same form & used SchoolCode field by which I can view information regarding each SchoolCode but the problem is that there are too many Schools so to make thinks simpler & easier, I want another Combo Box from tblCity & want to link it to existing combo box (SchoolCode Combo Box) & when I select any City, the field in SchoolCode Combo Box automatically change related to City & then When I select a specific SchoolCode (School) from SchoolCode Combo Box, the sub-form which is coming from tblStudent also changes (which was working before with SchoolCode combo box).
I hope you understand my issue.
Please guide me in detail as I'm not so good in coding. :(
 

phool4fool

Registered User.
Local time
Today, 10:06
Joined
Dec 10, 2011
Messages
34
This type of thing?

baldyweb/CascadingCombo.htm
Finally, it helped me. Thanks a lot...!!!
it helped me to link two combo boxes & now I want Two more things to do.
1- I want the user to Alert if the user don't select any value from the 2nd Combo box & want to restrict it to go further until the user select values from both combo boxes. (how can I achieve that???)
2- I've made Combo Boxes working (Select City Combo Box & Select School Combo Box) but now, I want to show records related to School Combo Box's selected value.
I hope you got the issue. So, how can I get that kind of results.
Waiting for your kind help.
 

Users who are viewing this thread

Top Bottom