>The Visual FoxPro documentation states:
>
>"For example, you might create a rule that compares the entry in the postal_code field of a table against a lookup table that contains the postal abbreviation codes for your country, and rejects any value that is not already present as a valid postal code abbreviation."
>
>I am try to accomplish a task similar to the postal abbreviation code validation. Could someone tell me what I need in my Field Validation Rule? An example based on the postal abbreviation code would be wonderful. Thank You.
You need to put the name of a function in the rule
DBSETPROP("MyTable","Table","RuleExpression","PostalCodeValidate()")
Then create a stored procedure in your dbc that does your checking for you, and returns .T. or .F. based on what it finds.
FUNCTION PostalodeValidate
IF !USED('PostalCodes')
USE PostalCodes IN 0
ENDIF
RETURN SEEK("CurrentTable.Code","PostalCodes","Code")
ENDFUNC
Or something like that. Might want to close the table if it was not open before and such and such...
Erik Moore
Clientelligence