Fwd: Re: Textbox Social Security Number

Author: kamcginnis@gmail.com

Posted: 2014-04-12 at 15:17:17

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/53499F4D.3090406@gmail.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.

©2014 kamcginnis@gmail.com