In requirement module one of the field should allow only R/A or SER-123 or SER-1234. (here nos 123 and 1234 will change for each time)It should not allow any other values.
Create a global variable to store the current value.
DIM g_save_value
=====================================================
Sub Req_New
….
g_save_value = ""
….
End Sub
=======================================================
Sub Req_MoveTo
….
g_save_value = Req_Fields.Field("RQ_USER_09")
….
End Sub
=======================================================
Function Req_FieldCanChange(FieldName, NewValue)
On Error Resume Next
Req_FieldCanChange = DefaultRes
If Req_Fields.Field("RQ_USER_09").IsModified then
NewValue = Req_Fields.Field("RQ_USER_09").Value
If PatternExists(NewValue,"DATA-[0-9][0-9][0-9]","False")= False then
If PatternExists(NewValue,"DATA-[0-9][0-9][0-9][0-9]","False") = False then
If PatternExists(NewValue,"N/A","False") = False then
msgbox " This field should allow R/A or SER-123 or SER-1234"
Req_Fields.Field("RQ_USER_09").Value = g_save_value
Req_FieldCanChange = False
End If
End If
End If
End If
On Error GoTo 0
End Function
I want to add the above function in only Req_FieldCanChange or I want to update in Req_CanPost etc. Please clarify.