J
Joy
in my macros, if user is to delete a task with actual work or the task is
complete, I will give a msg to let the user choose whether or not to delete it
the problem is: each time the msg prompts, after that the MS project will
also give a msgbox saying that the task has actual data, do you want to
delete it?
I am wondering how I can just let it show my own msgbox. I do not want to
let the msgbox show twice, which may make users not happy.
my codes:
' tsk is complete
If (tsk.PercentComplete = 100) Then
If MsgBox("Are you sure you want to delete the task? " _
& vbCrLf & Chr(13) & "It has been marked as complete.", vbYesNo +
vbCritical) = vbNo Then
Cancel = True
Exit Sub
Else
End If
' actual work >0
ElseIf Not (Left(tsk.ActualWork, 1) = "0") Then
If MsgBox("Are you sure you want to delete the task? " _
& vbCrLf & Chr(13) & "It has actual work. ", vbYesNo + vbCritical)
= vbNo Then
Cancel = True
Exit Sub
Else
Exit Sub
End If
thanks
complete, I will give a msg to let the user choose whether or not to delete it
the problem is: each time the msg prompts, after that the MS project will
also give a msgbox saying that the task has actual data, do you want to
delete it?
I am wondering how I can just let it show my own msgbox. I do not want to
let the msgbox show twice, which may make users not happy.
my codes:
' tsk is complete
If (tsk.PercentComplete = 100) Then
If MsgBox("Are you sure you want to delete the task? " _
& vbCrLf & Chr(13) & "It has been marked as complete.", vbYesNo +
vbCritical) = vbNo Then
Cancel = True
Exit Sub
Else
End If
' actual work >0
ElseIf Not (Left(tsk.ActualWork, 1) = "0") Then
If MsgBox("Are you sure you want to delete the task? " _
& vbCrLf & Chr(13) & "It has actual work. ", vbYesNo + vbCritical)
= vbNo Then
Cancel = True
Exit Sub
Else
Exit Sub
End If
thanks