|
-
Aug 30th, 2012, 09:00 AM
#1
Thread Starter
Frenzied Member
Combo Box triggers another comboxbox display
Hi,
On my form I have 3 combo boxes,
CmbTruckTyp (has dropdownlist of Daf & Mercedes Benz)
cmbDafModels (A, B , C)
cmdMercBenzModels (D, E, F)
On Form Load (by default)
Select Truck Type = CmbTruckTyp (Daf is at the top) Select Model = cmbDafModels (set to visible at form load and cmdMercBenzModels set to false)
Now when a user from the dropdownlist on CmbTruckTyp select Mercedes Benz I want to hide the contents of cmbDafModels and display cmdMercBenzModels instead.
How can I achieve that? Is it the right approach to do it? I might have other 3 combo boxes to add...
Tried;
Code:
Private Sub CmbTruckTyp_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CmbTruckTyp.SelectedIndexChanged
If Me.CmbTruckTyp.Text = "Mercedes-Benz" Then
cmdMercBenzModels.Visible = True
Else
cmbDafModels.Visible = False
End If
If Me.CmbTruckTyp.Text = "Daf" Then
cmbDafModels.Visible = True
Else
cmdMercBenzModels.Visible = False
End If
End Sub
No errors, but doesnt work!!
When I Select Mercendez Benz from the dropdownlist, cmbDafModels disappears but cmdMercBenzModels is not visible.
When I click Daf again cmbDafModels doesnt reappear.
Many thanks
Last edited by dr223; Aug 30th, 2012 at 09:14 AM.
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
|