J
Jose X Perez
hi everyone
I am using project professional 2007, and I have a macro that does some
calculations depending the outline level
this is the code
Private Sub App_ProjectBeforeTaskChange(ByVal t As Task, ByVal Field As
PjField, ByVal NewVal As Variant, Cancel As Boolean)
MsgBox Field
'If Field = pjTaskName Then
If Field = 188743767 Then
If t.OutlineLevel = 1 Then
't.Number2 = t.Number1 * t.Number3 / 100
t.Number2 = NewVal * t.Number3 / 100
Else
't.Number2 = t.Number1 * t.OutlineParent.Number2 / 100
t.Number2 = NewVal * t.OutlineParent.Number2 / 100
End If
End If
End Sub
Now i try to make it a formula in a custom field
an it goes like this.
IIf([Nivel de esquema]=1,[Número1]*[Número3]/100,[Número1]/100)
first problem, how can i express in the formula t.OutlineParent.Number2
I mind, how can i get the value of a parent task field to use in a
calculation of a custom field.
second problem, if the first cannot be solved.
Wich is the name of the field number1, in order to do not use the number?
i do not want to use
If Field = 188743767 Then
Thanks for your help
Jose X Perez
I am using project professional 2007, and I have a macro that does some
calculations depending the outline level
this is the code
Private Sub App_ProjectBeforeTaskChange(ByVal t As Task, ByVal Field As
PjField, ByVal NewVal As Variant, Cancel As Boolean)
MsgBox Field
'If Field = pjTaskName Then
If Field = 188743767 Then
If t.OutlineLevel = 1 Then
't.Number2 = t.Number1 * t.Number3 / 100
t.Number2 = NewVal * t.Number3 / 100
Else
't.Number2 = t.Number1 * t.OutlineParent.Number2 / 100
t.Number2 = NewVal * t.OutlineParent.Number2 / 100
End If
End If
End Sub
Now i try to make it a formula in a custom field
an it goes like this.
IIf([Nivel de esquema]=1,[Número1]*[Número3]/100,[Número1]/100)
first problem, how can i express in the formula t.OutlineParent.Number2
I mind, how can i get the value of a parent task field to use in a
calculation of a custom field.
second problem, if the first cannot be solved.
Wich is the name of the field number1, in order to do not use the number?
i do not want to use
If Field = 188743767 Then
Thanks for your help
Jose X Perez