Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Declarative Validation
Message
General information
Forum:
Visual FoxPro
Category:
Databases,Tables, Views, Indexing and SQL syntax
Miscellaneous
Thread ID:
00239695
Message ID:
00239713
Views:
25
>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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform