Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox validation
Message
From
04/11/2002 21:45:02
Ransome So
Ransome's Workshop
Hong Kong, Hong Kong
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Textbox validation
Miscellaneous
Thread ID:
00718783
Message ID:
00718783
Views:
49
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
Next
Reply
Map
View

Click here to load this message in the networking platform