Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox validation
Message
 
To
04/11/2002 21:45:02
Ransome So
Ransome's Workshop
Hong Kong, Hong Kong
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00718783
Message ID:
00718816
Views:
21
Ransome:
David's solution might be what you're looking for. You could also break the entry (it would require an additional tab or carriage return) into two operations:

The first entry would be a numeric text box.
.... the user would tab, enter or select out to your
second entry, a combo box, that would contain a list of numeric truncation units. The combo would default to blank for no truncation, or "C" for hundred, "K" for thousands, etc.

There is a one TextBox service. Require all numbers truncated to thousands (K)., so that 1.0 is 1000 and .001 is 1.

>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
Imagination is more important than knowledge
Previous
Reply
Map
View

Click here to load this message in the networking platform