What version of filemaker are you using ?
In FM10, you could use onObjectExit script trigger to achieve this
…or you can try this:
Edit the DateClosed field and check the Validate by calculation checkbox in the Validation tab. Specify the following calculation to Validate the field "DateClosed":
(Status = "Closed" and not IsEmpty(DateClosed)) or (Status ≠ "Closed")
Then uncheck "Validate only if field has been modified" at the bottom of the calculation area as well as the "Allow user to override during data entry" on the Validation dialog.
Optionally check "Dispaly custom message if validation fails" and enter your custom warning.
The warning is not displayed until the user tries to commit the changes to the record at which time, the user is given the option to:
• revert the record to its original state;
• click "OK" and have the cursor returned to the DateClosed field.