Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Text box cannot retain focus if value is .NULL.
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00459901
Message ID:
00460049
Vues:
28
>>>>try "set confirm on"
>>>
>>>no effect. I did manage to get it to stay in the textbox, but once the value = .NULL., it won't hold a different value. After adding a check in the gotfocus method, I was able to stay in the textbox and edit, but it reverted to null after moving to another control, so once a null value is ever entered, it cannot be changed to something else
>>>
>>
>>This sounds like it dates back to the beginning of Xbase when doing a GET on a field with an empty string would just skip past that field. I think to get around this, you can't bind the textbox directly to the field if you want to accept nulls in the field. Use a form property instead, and if the field is null, you'll have to pad it out with spaces so the user can actually enter something. How are you making a distinction in appearance between spaces and a null?
>
>
>Actually, I did not do anything special. I just now discovered this behavior after more than 2 years using VFP. The database I am using is different from the usual ones I deal with. It just displays .NULL. The control is actually bound to an object property corresponding to a table field in SQL Server 7. I can, of course change the objects to substitute something reasonable for a null value
>

My question, though, was how can you tell the user wants to change the field to a null vs just spaces? Do you need the distinction? If not, padding the property with spaces will work, and you can just change it to null before you update the back end.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform