Forms, check boxes linking to a list

V

Vanna

Any help would be very much appreciated....

I would like to create a group of 3 check boxes say containing Editor,
reviewer and Approver. These check boxes should be mutually exclusive. If
the user selects the editor check box, a drop down list containing only
Editors for the user to choose and if the user checks the Reviewer, then the
list of reviewers names appear and so on.

In advance, than you for your help.
 
A

AlexM4096

Is this what you're after?

Create a form with three checkboxes named 'ApprChBox', 'EditChBox', and
'RevwChBox', and a combobox named 'TheListCombo' and put this code in the
form:

'-->In a form
Private Sub ApprChBox_Change()
Dim A$
'Save the last selected item
A$ = TheListCombo.Text

'Clear the list
TheListCombo.Clear

'Add Approved names if checked
If ApprChBox.Value = True Then
Call TheListCombo.AddItem("Appr1", TheListCombo.ListCount)
Call TheListCombo.AddItem("Appr2", TheListCombo.ListCount)
End If
'Add Edit names if checked
If EditChBox.Value = True Then
Call TheListCombo.AddItem("Edit1", TheListCombo.ListCount)
Call TheListCombo.AddItem("Edit2", TheListCombo.ListCount)
End If
'Add Reviewed names if checked
If RevwChBox.Value = True Then
Call TheListCombo.AddItem("Review1", TheListCombo.ListCount)
Call TheListCombo.AddItem("Review2", TheListCombo.ListCount)
End If

'If the last selected item is in new list then leave, if not then delete
For I = 0 To TheListCombo.ListCount - 1
If LCase(TheListCombo.List(I)) = LCase(A$) Then
TheListCombo.Text = A$
Exit For
End If
Next I
End Sub
Private Sub EditChBox_Change(): ApprChBox_Change
End Sub
Private Sub RevwChBox_Change(): ApprChBox_Change
End Sub
'-->End of Code

I hope this helps you any
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top