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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

MS Project VB Loop Statement

Status
Not open for further replies.

remeng

Technical User
Jul 27, 2006
520
US
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.


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
 
Does anyone know how I can get around the Multi Page error:

&H80070057 (-2147024809) The Parameter Is Incorrect

What's happening is that I am creating a form and adding a multipage to it. When I close the MS Project doc, I receive this error. When I re-open the project, all of my code and the form aren't save and are lost.

 
And this only happens when you add the Multipage control to a userform?
 
Other people have reported a similar problem with Project 2010. Looks like you need to get all the latest patches applied. There is a suggestion that there is a hotfix as well, but I can't track the specific one down as yet.
 
My IT department applied the hotfix and it didn't work. Also the latest updates have been installed...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top