Verification Rule based on data in another field

randallst

Registered User.
Local time
Today, 15:42
Joined
Jan 28, 2015
Messages
64
Hi There,

I want to set a rule where employees cannot change the "Status" from "Active" to "Closed" if there is no date entered in the "Actual Closure Date" field.

The 2 fields I am trying to create a rule for are called 'Actual Closure Date' and 'Status'.
When we raise an incident the 'Status' is set to 'Active' and the 'Actual Closure Date' field is left blank as it hasn't yet been closed.
What I want to do is prevent people setting the 'Status' to 'Closed' when they havent entered a date in the 'Actual Closure Date' field.
The Form name is called 'Issue Details' and the information is stored in a table called 'Issues'. Hopefully that makes sence aha!

It is probably very simple but I am just confussing myself now, and thats not good at 09:00 aha! Any help is greatly appreciated.

All the best
Stu :)
 
First of all, you talk of fields. But we're in the Forms forum. Therefore there should be Controls bound to your fields.

So, is the Status a combobox with options of Active and Closed?

My other question is why you would need such a field in the first place. If your date is entered, your status is Closed, if it's not entered, it's Active. This can be calculated any time, therefore storing it would be redundant.
 
You can create a BeforeUpdate event for the field of "Status" like

Private Sub Status_BeforeUpdate(Cancel as Integer)
If Nz(Actual Closure Date) ="" Then
MsgBox "Actual Closure Date is required first."
Cancel = True
Status.Undo
End If
End Sub

BTW, if "Actual Closure Date" is the field's real name, try not to use spaces in the name.

Shoji
 
You can create a BeforeUpdate event for the field of "Status" like

Private Sub Status_BeforeUpdate(Cancel as Integer)
If Nz(Actual Closure Date) ="" Then
MsgBox "Actual Closure Date is required first."
Cancel = True
Status.Undo
End If
End Sub

BTW, if "Actual Closure Date" is the field's real name, try not to use spaces in the name.

Shoji


Sorry for the delay in getting back in touch, have been on days off. That worked a treat! Thank you so much for your help :)
 

Users who are viewing this thread

Back
Top Bottom