Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox numeric formatting
Message
From
17/11/2014 09:51:20
 
 
To
17/11/2014 09:22:40
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows Server 2012
Network:
Windows 2008 Server
Database:
MS SQL Server
Application:
Web
Miscellaneous
Thread ID:
01611077
Message ID:
01611094
Views:
60
>>>>>>Should be simple but I'm rusty..
>>>>>>
>>>>>>In a Form.Init() I create a cursor:
CREATE CURSOR xxx (
>>>>>>    MyField N(6,1)
>>>>>>)
>>>>>>APPE BLANK
If I open this in a browse window I can enter data as expected (e.g. typing '12345' gives '1234.5').
>>>>>>In the form I have a textbox with DataSource = xxx.MyField.
>>>>>>If I enter the same keystrokes here I get '1.24' and it tabs to the next item.
>>>>>>
>>>>>>What am I missing?
>>>>>
>>>>>It should be ControlSource, but I assume this is a typo.
>>>>
>>>>Yup, sorry - typo.
>>>>
>>>>>Check what is InputMask property of this TextBox.
>>>>
>>>>I'm not setting it in the designer and it's an empty string at runtime....
>>>
>>>Try to set Value of this TextBox to 0.0 before settinmg the ControlSource:
>>>
>>>thisform.TextBox.Value = 0.0
>>>thisform.TextBox.ControlSource = "xxx.MyField"
>>>
>>
>>If either of those run before the cursor has been created I get Error 5 (Record is out of range)
>>If after then still makes no difference to the UI...
>
>
>I would create the cursor in the Load() of the form rather than in the Init()

DUH. Textbox wasn't wide enough. Guess I was expecting it to 'scroll'

Thx to all for the attempts against my stupidity :-}
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform