Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Textbox validation
Message
De
04/11/2002 21:45:02
Ransome So
Ransome's Workshop
Hong Kong, Hong Kong
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Textbox validation
Divers
Thread ID:
00718783
Message ID:
00718783
Vues:
50
Dear all,

In order to proide the user entering numeric datas in the format ??K,
so that when 20K is entered; the entry will actually 20,000
and if 20000 is entered; the entry will be straght follow 20,000
in the textbox valid event I add:

if right(this.value,1)="K" .or. right(this.value,1) = "k"
this.value=val(substr(this.value,1,len(this.value)-1)*1000)
else
this.value=val(this.value)
endif

The implementation is found run well.

However, when I make the controlsource of the textbox to be a numeric field of the table, problem is found that I can not enter ??K format, for "K" is non-numeric;

I add a line at the about valid event to solve:

thisform.anothertextbox.value=this.value;

in which delete the controlsource of the textbox; but make the controlsource of the anothertextbox be the original field I assign for the textbox.

Besides this solution, is there any alternative ??



Regards,

Ransome
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform