Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Field Validation Rules and null or empty values
Message
 
To
29/07/1997 15:27:18
Matt Mc Donnell
Mc Donnell Software Consulting
Boston, Massachusetts, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00042123
Message ID:
00042178
Views:
76
>>>>>I have a character field named VAN that allows null values in my table. I want to create a Field Validation Rule that will allow the entry of "EW", "VC", or leave it empty. What is the correct syntax for this? When I try van=="EW".OR.van=="VC".OR.van=.NULL. it allows me to enter any value (i.e. "DD"). Any ideas?
>>>>>
>>>>>Thanks!
>>>>>
>>>>>Jeff
>>>>
>>>>Use either textbox with
>>>>.Format="M"
>>>>.Inputmask=",EW,VC"
>>>>or even better small combobox.
>>>>You can convert empty value into .NULL. in code before saving.
>>>
>>>Thanks for the reply Edward. But I'm trying to set the field validation rule so users won't be able to enter incorrect values from MS Query. I don't understand why van=="EW".OR.van=="VC".OR.van=.NULL. won't work. In another field I'm using drivcode="EMP".OR.drivcode="STU".OR.drivcode="VOL" and it works great. But if I change it to drivcode="EMP".OR.drivcode="STU".OR.drivcode="VOL".OR.drivcode=.null. it doesn't work -- it allows any characters to be entered.
>>>
>>>Is this a bug or what?
>>>
>>>Jeff
>>
>>I don't know. Honestly, I don't use field-validation rules.
>
>Hey Jeff, have you tried ISNULL()?
>
>Matt

Hi Matt,

I tried van=="EW".OR.van=="VC".OR.ISNULL(van)=.t. but that didn't work either. I was trying to set the field validation rules prior to using the upsize wizard to create the table structure in MS SQL server. The upsize wizard automatically created the stored procedures on the SQL server, but van='VC'or van='EW'or van= null did not work here either, but van='VC'or van='EW'or van= '' DOES work.

Thanks.

Jeff
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform