hi
the code below works great but I need some help to modify it
what I also need is that if the user enters the dateclosed and does not change the status field to closed the strMsg = "status field must be changed to closed " will prompt the user
thanks for your help
steve
the code below works great but I need some help to modify it
what I also need is that if the user enters the dateclosed and does not change the status field to closed the strMsg = "status field must be changed to closed " will prompt the user
Code:
Private Sub Form_BeforeUpdate(Cancel As Integer)
Dim strMsg As String
If [Status] = "Closed" Then
If Len([targetDate] & "") = 0 Then
'
strMsg = "targetdate is mandatory" '& vbCrLf
Cancel = True
End If
If Nz([Dateclosed], 0) = 0 Then
strMsg = "Date Closed is mandatory"
Cancel = True
End If
If Cancel = True Then
If Nz([Action Taken], 0) = 0 Then
strMsg = "action taken is mandatory"
Cancel = True
End If
If Cancel = True Then
MsgBox strMsg
End If
End If
End If
End Sub
thanks for your help
steve