Hi all,
I have a form in MS Project 2010 that I am trying to create. I am thinking the Loop statement might be the way to go for this, but I'm not sure since I haven't used VB in a while. Here is the scenario; I want to have a series of check boxes that will allow the user to select different tests to perform. I already have created a single check box scenario that works, but I don't know if there is a better way to go through 20 different check boxes since I don't want to repeat common code (checking status of the next box). I want to see if it the check box is either True or False and to take a similar action to the ElseIf statement then go to the next check box status.
Example:
[ ] Test 1
[x] Test 2
[x] Test 3
[ ] Test 4
returns to MS Project:
Test 2 is added to the time line.
Test 3 is added to the time line.
Test 1 is ignored.
Test 4 is ignored.
Thank you,
Mike
I have a form in MS Project 2010 that I am trying to create. I am thinking the Loop statement might be the way to go for this, but I'm not sure since I haven't used VB in a while. Here is the scenario; I want to have a series of check boxes that will allow the user to select different tests to perform. I already have created a single check box scenario that works, but I don't know if there is a better way to go through 20 different check boxes since I don't want to repeat common code (checking status of the next box). I want to see if it the check box is either True or False and to take a similar action to the ElseIf statement then go to the next check box status.
Example:
[ ] Test 1
[x] Test 2
[x] Test 3
[ ] Test 4
returns to MS Project:
Test 2 is added to the time line.
Test 3 is added to the time line.
Test 1 is ignored.
Test 4 is ignored.
Code:
Private Sub CommandButton1_Click()
Dim ckeck
Dim bob
Dim test_identifier
check = CheckBox1
If check = False Then
bob = test_identifier_value
SelectTaskField Row:=0, Column:="Name"
SetTaskField Field:="Name", Value:=bob
SelectTaskField Row:=1, Column:="Name"
OutlineIndent
ElseIf CheckBox1.Value = True Then
bob = "test identifier"
SelectTaskField Row:=0, Column:="Name"
SetTaskField Field:="Name", Value:=bob
SelectTaskField Row:=1, Column:="Name"
OutlineIndent
End If
End Sub
Thank you,
Mike