can anybody send me code on the following VB6.

TOTAL 4 COMBO BOX:
1) when form load, all the combo boxes are blank
2) When selecting one combo box item, it effect other combo box
ex : in first combo box we have entry of all the countries in the world ex: India, Pakistan, South Africa etc.
When we select India, all the states of India will appear in second combo box. ex: India having following states like Orissa, Bihar, Jammu & Kashmir, Maharashtra etc. If we select other Country like Pakistan, all the states of Pakistan will only appear in second combo box.
When we select Maharashtra state (2nd combo box) in India (1st Combo box), all metro cities of mahatrashtra will only appear in 3rd combo box like mumbai, pune, nashik etc.
When we select Metro city, all the banks working the respective city will appear in 4th combo box.

(SELECTION OF CONTENT IN ONE COMBO BOX AFFECT THE DISPLAY THE CONTENT OF OTHER COMBO BOX.)

Recommended Answers

All 10 Replies

can anybody send me code on the following VB6.

TOTAL 4 COMBO BOX:
1) when form load, all the combo boxes are blank
2) When selecting one combo box item, it effect other combo box
ex : in first combo box we have entry of all the countries in the world ex: India, Pakistan, South Africa etc.
When we select India, all the states of India will appear in second combo box. ex: India having following states like Orissa, Bihar, Jammu & Kashmir, Maharashtra etc. If we select other Country like Pakistan, all the states of Pakistan will only appear in second combo box.
When we select Maharashtra state (2nd combo box) in India (1st Combo box), all metro cities of mahatrashtra will only appear in 3rd combo box like mumbai, pune, nashik etc.
When we select Metro city, all the banks working the respective city will appear in 4th combo box.

(SELECTION OF CONTENT IN ONE COMBO BOX AFFECT THE DISPLAY THE CONTENT OF OTHER COMBO BOX.)

vishaldalya,

I'm holding off on reporting your post for one reason only, and that is because you are new to this forum, but as things go... We will not do your homework for you. You want it done for you, goto http://www.rentacoder.com or http://www.odesk.com and put your homework up for bid.

Now, with that said, let me ask. Have you even tried to code this yourself? If you have. What does your code look like? As we will be happy to help you with your code and any problems you are having with it, but like I wrote. We will not do your homework for you.

Hint: AddItem method and Click Event...

Good Luck

Hi vishaldalya,

Find the attached help. Please rate my post if it was helpful.

thanks

Hi
Please find the attached help. In this help i have a set of records saved in Database(MSAccess 2003). The records are loaded from that databases.

Hope this helps.

Have you designed the database according to your requirement ?

friend, u have developed a very good program but rather than developing such long database, i am considering only one country i.e. India
In India also we have to first create database for all the states, then its cities and then repective Bank with bank BSR Codes. I got some readymade database for it but its not in mdb form. How to use this database to get solution.
thanks in advance.

i can not download these readymade files as it showing invalid files.

ex: maharashtra.ENC , assam.ENC which the website does not support. Can i use it in my work. How to use it.

Hi,
I am not sure whether you can use .ENC file however if you can read the contents of that file i think you can save that file in other format like .DAT or .BAS or .TXT which VB can read and load.

Thanks

Just give me your email address so i can send you mail. Its very urgent. I think you can help me. I got the readymade database. Its very difficult to create database. If i forgotten to use some area/fields it would create problem.

waiting for reply

I have sent you a private message

I think this will work for you. This is without database. You can add database then it will become more reliable and with more choice.

Private Sub Combo1_Click()
If Combo1.Text = "Nation_1" Then
secondcombo (1)
ElseIf Combo1.Text = "Nation_2" Then
secondcombo (2)
ElseIf Combo1.Text = "Nation_3" Then
secondcombo (3)
End If
End Sub
'for selecting the state
Public Sub secondcombo(state)
Combo2.Clear
If state = 1 Then
Combo2.AddItem ("Nation1_State1")
Combo2.AddItem ("Nation1_State2")
Combo2.AddItem ("Nation1_State3")
Combo2.AddItem ("Nation1_State4")
Combo2.AddItem ("Nation1_State5")
ElseIf state = 2 Then
Combo2.AddItem ("Nation2_State1")
Combo2.AddItem ("Nation2_State2")
Combo2.AddItem ("Nation2_State3")
Combo2.AddItem ("Nation2_State4")
Combo2.AddItem ("Nation2_State5")
ElseIf state = 3 Then
Combo2.AddItem ("Nation3_State1")
Combo2.AddItem ("Nation3_State2")
Combo2.AddItem ("Nation3_State3")
Combo2.AddItem ("Nation3_State4")
Combo2.AddItem ("Nation3_State5")
End If
End Sub
'for selecting the dist
Public Sub thirdcombo(dis)
Combo3.Clear
If dis = 1 Then
Combo3.AddItem ("State1_Dis1")
Combo3.AddItem ("State1_Dis2")
Combo3.AddItem ("State1_Dis3")
Combo3.AddItem ("State1_Dis4")
Combo3.AddItem ("State1_Dis5")
ElseIf dis2 = 2 Then
Combo3.AddItem ("State2_Dis1")
Combo3.AddItem ("State2_Dis2")
Combo3.AddItem ("State2_Dis3")
Combo3.AddItem ("State2_Dis4")
Combo3.AddItem ("State2_Dis5")
ElseIf dis = 3 Then
Combo3.AddItem ("State3_Dis1")
Combo3.AddItem ("State3_Dis2")
Combo3.AddItem ("State3_Dis3")
Combo3.AddItem ("State3_Dis4")
Combo3.AddItem ("State3_Dis5")
ElseIf dis = 4 Then
Combo3.AddItem ("State4_Dis1")
Combo3.AddItem ("State4_Dis2")
Combo3.AddItem ("State4_Dis3")
Combo3.AddItem ("State4_Dis4")
Combo3.AddItem ("State4_Dis5")
ElseIf dis = 5 Then
Combo3.AddItem ("State5_Dis1")
Combo3.AddItem ("State5_Dis2")
Combo3.AddItem ("State5_Dis3")
Combo3.AddItem ("State5_Dis4")
Combo3.AddItem ("State5_Dis5")
End If
End Sub

Private Sub Combo2_Click()
If Combo2.Text = "Nation1_State1" Or Combo2.Text = "Nation2_State1" Or Combo2.Text = "Nation3_State1" Then
thirdcombo (1)
ElseIf Combo2.Text = "Nation1_State2" Or Combo2.Text = "Nation2_State2" Or Combo2.Text = "Nation3_State2" Then
thirdcombo (2)
ElseIf Combo2.Text = "Nation1_State3" Or Combo2.Text = "Nation2_State3" Or Combo2.Text = "Nation3_State3" Then
thirdcombo (3)
ElseIf Combo2.Text = "Nation1_State4" Or Combo2.Text = "Nation2_State4" Or Combo2.Text = "Nation3_State4" Then
thirdcombo (4)
ElseIf Combo2.Text = "Nation1_State5" Or Combo2.Text = "Nation2_State5" Or Combo2.Text = "Nation3_State5" Then
thirdcombo (5)
End If
End Sub
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.