>>>>>>>>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 :-}
>
>Hrm... Perhaps assigning the InputMask property might work?
>
>... or perhaps not. Just tried it - out of curiosity. Indeed you will indeed get scrolling, though behavior is likely to confuse the user. For character value input the scrolling is "continuous" on a character-by-character basis, but for numeric it "jumps" between sets of digits. For example, if the field is wide enough for 5 digits, but the InputMask specifies 10 digts -- as you input, you see the first 5 digits, then it "jumps" to next 4 digits as you input -- so if you're inputting 1234567890, you first see "1234" then "5678", then "90". You'll see the "jumping" as you step through input field with the cursor keys -- though theare were times where "jump" between sets of digits wasn't always consistent and resulted in "jumbled" value being displayed (e.g. I'd input "12345" but there were situations where I'd see "1234" or "1235" depending on various conditions -- but the VALUE property did contain 12345). If you've got a decimal point, then it tends to "jump" between whole number and fractional part as well.
Not nice. I tried setting the inputmask during my thrashing around and rapidly concluded that for normal numeric values it was pretty much unusable. Probably OK for formatting stuff like phone numbers tho.....