Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

based choices on option group based on selection on other option group 1

Status
Not open for further replies.

tizwaz

Technical User
Aug 8, 2002
437
0
0
GB
I have several option groups and want to limit the choices on one based on the the selection in another - can this be done say on the after update event of the 1st one? If so how would I do it?

for example the 1st option group has 2 choices and the 2nd option group has 6 choices which relate to the 1st choice and 6 that relate to the 2nd. I want the choice in the 2nd option group limited to the relavant 6 choices
 
I named my option buttons OptA through OptF in the second option group. I used the locked property, but you could use the visible property or other properties
Code:
Private Sub optGrpTwo_Enter()
  'Lock options D-F if they pick the first option in the first option group
  OptD.Locked = (optGrpOne.Value = 1)
  optE.Locked = (optGrpOne.Value = 1)
  optF.Locked = (optGrpOne.Value = 1)
 'Lock options A-C if they pick the second option in the first option group
  optA.Locked = (optGrpOne.Value = 2)
  optB.Locked = (optGrpOne.Value = 2)
  optC.Locked = (optGrpOne.Value = 2)
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top