Q
QW15IEJyb29rcw
Hi,
I have two combo boxes, one named Division, the other named Sub-Division.
I want to make it so that if you select (for example) Ambulance from the
Division list, the Sub-Division list will only show related items, like NHS,
Private, Air. The lists are as follows:
Ambulance
Air
NHS
Private
Voluntary
Vehicle Builder
Export
Distributor
End User
Group
Hospital
NHS
Private
Distributor
Industry
N/A
Mortuary
Distributor
Funeral Director
The code I have so far is:
----------------------------------------------------------------Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "cboDivision"
Call SetSubDivision
End Select
End Sub
_______
Sub SetSubDivision
Set objInsp = Item.GetInspector
Set objPage = objInsp.ModifiedFormPages("General")
Set Division = objPage.Controls("cboSubDivision")
Select Case Item.UserProperties ("cboDivision")
Case "Ambulance"
cboSubDivision.List = Split("Air,NHS,Private,Vehicle Builder,Voluntary",",")
Case "Export"
cboSubDivision.List = Split("Distributor,End User,Ferno Group",",")
Case "Hospital"
cboSubDivision.List = Split("Distributor,MOD,NHS,Private",",")
Case "Industry"
cboSubDivision.List = Split("N/A",",")
Case "Mortuary"
cboSubDivision.List = Split("Distributor,Funeral Director",",")
End Select
End Sub
----------------------------------------------------------------I'm not sure if this is correct, or where to put it.
Help would be appreciated!
Thanks,
Amy
I have two combo boxes, one named Division, the other named Sub-Division.
I want to make it so that if you select (for example) Ambulance from the
Division list, the Sub-Division list will only show related items, like NHS,
Private, Air. The lists are as follows:
Ambulance
Air
NHS
Private
Voluntary
Vehicle Builder
Export
Distributor
End User
Group
Hospital
NHS
Private
Distributor
Industry
N/A
Mortuary
Distributor
Funeral Director
The code I have so far is:
----------------------------------------------------------------Sub Item_CustomPropertyChange(ByVal Name)
Select Case Name
Case "cboDivision"
Call SetSubDivision
End Select
End Sub
_______
Sub SetSubDivision
Set objInsp = Item.GetInspector
Set objPage = objInsp.ModifiedFormPages("General")
Set Division = objPage.Controls("cboSubDivision")
Select Case Item.UserProperties ("cboDivision")
Case "Ambulance"
cboSubDivision.List = Split("Air,NHS,Private,Vehicle Builder,Voluntary",",")
Case "Export"
cboSubDivision.List = Split("Distributor,End User,Ferno Group",",")
Case "Hospital"
cboSubDivision.List = Split("Distributor,MOD,NHS,Private",",")
Case "Industry"
cboSubDivision.List = Split("N/A",",")
Case "Mortuary"
cboSubDivision.List = Split("Distributor,Funeral Director",",")
End Select
End Sub
----------------------------------------------------------------I'm not sure if this is correct, or where to put it.
Help would be appreciated!
Thanks,
Amy