dbTalk Databases Forums  

Visual Foxpro 3 - Validation Rule problems

comp.databases.xbase.fox comp.databases.xbase.fox


Discuss Visual Foxpro 3 - Validation Rule problems in the comp.databases.xbase.fox forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Boulent Mustafa
 
Posts: n/a

Default Visual Foxpro 3 - Validation Rule problems - 08-10-2004 , 07:15 AM






Field Definition is character of 1 length

Validation rule is if (gender) # "m" .OR. (.NOT. gender) = "M" .OR.
(.NOT. gender) = "f" .OR. (.NOT. gender) = "F"

Validation text is "Valid Inputs are m, M, f or F. If Gender is m or M
then Title 1 must be he and Title 2 must be his or if Gender is f or F
then Title 1 must be she and must be her."

Upon data entry in the gender field, the if clause is attempting to be
executed as a program and hence the following error is displayed file
"if.prg" does not exist.

The validation text then appears but when you click ok and attempt to
click save or revert from the data entry screen the program doesn't
allow you to exit and keeps displaying the file "if.prg" does not
exist message

As a result I have to ctrl+alt+del out of Visual Foxpro.

Reply With Quote
  #2  
Old   
Rick Bean
 
Posts: n/a

Default Re: Visual Foxpro 3 - Validation Rule problems - 08-10-2004 , 08:13 AM






I believe an easier check would be:
IF not (gender $ "mMfF")

Note: the n proper syntax of your statement would be:
IF gender # "m" .OR. .NOT. (gender = "M") .OR. ;
.NOT. (gender = "f") .OR. .NOT. (gender = "F")

alternately


IF gender # "m" .OR. gender # "M" .OR. ;
gender # "f") .OR. gender # "F"

Rick

"Boulent Mustafa" <OhWhite (AT) hotmail (DOT) com> wrote

Quote:
Field Definition is character of 1 length

Validation rule is if (gender) # "m" .OR. (.NOT. gender) = "M" .OR.
(.NOT. gender) = "f" .OR. (.NOT. gender) = "F"

Validation text is "Valid Inputs are m, M, f or F. If Gender is m or M
then Title 1 must be he and Title 2 must be his or if Gender is f or F
then Title 1 must be she and must be her."

Upon data entry in the gender field, the if clause is attempting to be
executed as a program and hence the following error is displayed file
"if.prg" does not exist.

The validation text then appears but when you click ok and attempt to
click save or revert from the data entry screen the program doesn't
allow you to exit and keeps displaying the file "if.prg" does not
exist message

As a result I have to ctrl+alt+del out of Visual Foxpro.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.