Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Text box with numbers
Message
 
To
21/09/1999 05:26:39
Carlos Avila
Tecnologia de Redes S.A.
San José, Costa Rica
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00266990
Message ID:
00266997
Views:
21
>I have a table with code an description
>In the form I use a textbox to get these values. For the code I use an input mask of 99999.
>I check for the code so that it does not repeat when adding a new item. Also I check that both code and description are added.
>The problem is when I add an item, the default value for the code is zero, although no value is displayed. If I check for this value for not null it returns false (because it has a zero). If I add a description and save it, it saves the description and .null. for the code. If in the list I have another item with a zero code, the routine will tell that the code already exists.

Have you tried testing for EMPTY() rather than null? A var with a value of zero won't evaluate to null but will evaluate to empty. For example:

lnVar = 0
? ISNULL(lnVar)
? EMPTY(lnVar)

will yield:
.F.
.T.

lnVar is not null but is empty in this case. HTH, Bill
Oct 31 = Dec 25
Previous
Reply
Map
View

Click here to load this message in the networking platform