I would use an intermediate .controlSource such as a Form.Property, or manage .value myself without .controlSource
controlSource = 'thisForm.property'
procedure refresh
store table.field to (this.controlSource)
procedure thisForm.property_assign
lparameters propertyValue
replace in table field with padl(ltrim(m.propertyValue, '0'), 9)
this.property = padl(propertyValue, 9, '0')
>Hi Gang!
>
>Question....
>
>We have need to start using a field in a table that is, at the moment, Numeric (11,0), but in the future, to be Character C(11). The reason is government, of course... wanting to have Alpha data at the end of the numeric part.
>
>When the page would come up for the field on the form, in the past, the user could type in numeric data and be happy.
>
>Then, it came to pass that some entities wanted to have this padded on the left with '0's. Like 123 became 00000000123 when sent to the processor (as a string, not as a numeric at this point. It was still stored as numeric on the Server with NO leading 0's.
>
>This was handled by setting the FORMAT of the textbox for this field to be 'L' ( place leading 0's) and a Inputmask of 99999999999... but only for a numeric field.
>
>------
>
>NOW... they want to be able to have alpha data on the end of the field.... so we must change it to be C(11).
>
>Problem is -> How do you have the textbox to show leading '0's on the textbox, and be Editable at all times, yet be stored in the field WITHOUT the leading '0s'.
>( 123AB become 000000123AB in the textbox but in the stored field it will be ' 123AB' )
>
>
>Thanks!
>Tommy
Thierry Nivelet
FoxinCloud
Give your VFP application a second life, web-based, in YOUR cloud
http://foxincloud.com/Never explain, never complain (Queen Elizabeth II)