>>>I am trying to do the following:
>>>I have a grid with a field called clock number
>>>This field can be up to 4 numbers.
>>>If the user enters a 3 digit number I ewant to right pad the value with a 0.
>>>
>>>I have done this successfully on fields in the valid event thusly:
>>>
>>>this.value=right('0000'+allt(this.value),4)
>>>This.refresh
>>>
>>>However when the same snippet is placed in the valid event of the grid text box, it doesn't seem to work. (The string is not padded.)
>>>
>>>Also, I have placed a combo control in the same cell, that is activated if the above value is not found in the employee list. It works, however (i.e. the combo box appears) but the focus does not stay with the combo box. (It moves to the next adjacent cell.)
>>>
>>>Any ideas?
>>>
>>>Thanks in advance,
>>>
>>>Mike
>>
>>It seem to me that you code this.value=right('0000'+allt(this.value),4) actually show leading zeros for integer data, and this task could be implemented by setting:
>>Column.Text.Format="L"
>>Column.Text.Inputmask="9999"
>>Column.Sparse=.F.
>>Another problem (show list of values) can be resolved by using Column.Combo with Combo.Style=0
>
>The data is of character format, not integer...
>Tried above, did not seem to make a difference. (Not combo box change though.)
>
>Thanks for the ideas,
>
>Mike
Mike, you can use Integer in Grid even if you have Char in Table, assuming that Grid.Column is Read-only.
Edward Pikman
Independent Consultant