Author: Jeff Johnson
Posted: 2014-04-14 at 08:23:32
.format - "KRL" does the trick. The reason I don't change to a string
is because this application is many years old and deployed in numerous
locations throughout the US and Canada. I avoid file format changes if
at all possible. In newer applications I am storing phone numbers and
social security numbers in text.
Thanks all for your help.
On 4/12/2014 1:17 PM, kamcginnis@gmail.com wrote:
> revise my response below. I had a function on the INIT of that text
> box that sets the format and inputmask
>
> toobject.Format = "KRZ"
> toobject.InputMask = "###-##-####"
>
> Hope this helps:
> I am using VFP9 SP2
>
> I have a text box on a form I named txtcSSN
> It has a control source: vnmpt.cssn which is a view for a table with the
> field named cSSB C(9)
> The input mask is 999-99-9999 (same as yours)
> The width is 90
>
> Mine works the way you want. Not sure why yours does not.
>
>
> On 4/12/2014 8:56 AM, Vincent Teachout wrote:
>> Jeff Johnson wrote:
>>> Greetings: I have a text box who's control source is a social
>>> security number stored as a number. Obviously I have done this for
>>> years. Yesterday it was brought to my attention that the leading
>>> zero messed up the formatting:
>>>
>>> 012566666 produces 125-66-666 instead of 012-56-6666. I am using an
>>> input mask of 999-99-9999.
>>>
>>> What do I need to do to fix this.
>>
>> If you're not going to do math with it, it shouldn't be stored as a
>> number. Change the field to a char(9), convert the numbers to char
>> strings (tranform(), str(), whatever you want), input with format of
>> @R and input mask of 999-99-9999.
>>
>> If you're really, really sure that the mangled numbers are always
>> missing one or more zeros, then once you're changed the field to char,
>> you can replace all ssn with padl(alltrim(ssn)),9,'0')
>>
>>
[excessive quoting removed by server]
_______________________________________________
Post Messages to: ProFox@leafe.com
Subscription Maintenance: http://mail.leafe.com/mailman/listinfo/profox
OT-free version of this list: http://mail.leafe.com/mailman/listinfo/profoxtech
Searchable Archive: http://leafe.com/archives/search/profox
This message: http://leafe.com/archives/byMID/profox/534BE154.9090107@san-dc.com
** All postings, unless explicitly stated otherwise, are the opinions of the author, and do not constitute legal or medical advice. This statement is added to the messages for those lawyers who are too stupid to see the obvious.