N
NevilleT
I am trying to update the percent complete on a task when a custom field
(Number2) changes. A custom field (Number3) contains a formula that
calculates the perecent complete using Number2.
I am using Project 2000. The main code is:
Private Sub Project_Change(ByVal pj As Project)
Dim lngCalcPercent As Long
SelectTaskField row:=0, Column:="Number3"
lngCalcPercent = ActiveCell.Task.Number3
SelectTaskField row:=0, Column:="PercentComplete"
If ActiveCell.Task.PercentComplete <> lngCalcPercent Then
ActiveCell.Task.PercentComplete = lngCalcPercent
End If
End Sub
The problem is that if the user hits the enter or down arrow key after
entry, the change event is triggered in the wrong row. It is in the row
below the task that was changed. Is there any way to replace the line:
SelectTaskField row:=0, Column:="Number3"
With a command that identifies the row where the change took place, or
alternatively fire the event prior to the focus moving to another task.
(Number2) changes. A custom field (Number3) contains a formula that
calculates the perecent complete using Number2.
I am using Project 2000. The main code is:
Private Sub Project_Change(ByVal pj As Project)
Dim lngCalcPercent As Long
SelectTaskField row:=0, Column:="Number3"
lngCalcPercent = ActiveCell.Task.Number3
SelectTaskField row:=0, Column:="PercentComplete"
If ActiveCell.Task.PercentComplete <> lngCalcPercent Then
ActiveCell.Task.PercentComplete = lngCalcPercent
End If
End Sub
The problem is that if the user hits the enter or down arrow key after
entry, the change event is triggered in the wrong row. It is in the row
below the task that was changed. Is there any way to replace the line:
SelectTaskField row:=0, Column:="Number3"
With a command that identifies the row where the change took place, or
alternatively fire the event prior to the focus moving to another task.