Hi experts,
I am trying to make the Closing Date field become mandatory and autopopulate with "today's" date when the Status field = Closed, Rejected, or Deferred. I am able to make this work for only Closed status, but am having trouble when I add Rejected and Deferred. Please advise
Sub Bug_FieldChange(FieldName)
On Error Resume Next
If FieldName="BG_STATUS" then
If Bug_Fields("BG_STATUS").value="Closed" then
Bug_Fields("BG_CLOSING_DATE").IsRequired=True
Bug_Fields("BG_CLOSING_DATE").Value= date
Else if Bug_Fields("BG_STATUS").value="Deferred" then
Bug_Fields("BG_CLOSING_DATE").IsRequired=True
Bug_Fields("BG_CLOSING_DATE").Value= date
Else if Bug_Fields("BG_STATUS").value="Rejected" then
Bug_Fields("BG_CLOSING_DATE").IsRequired=True
Bug_Fields("BG_CLOSING_DATE").Value= date
End If
Else
Bug_Fields("BG_USER_02").IsRequired=False
End If
PrintError "Bug_FieldChange"
On Error GoTo 0
End Sub