I have a numeric field defined in an Access97 table. This field contains Social Security Numbers. How do I format the data in my report so that it prints ###-##-#### rather than ###,###,###
I can't seem to find the Picture function. When I click Check, I get the message "The remaining text does not appear to be part of the formula." and the cursor goes to the beginning of the formula.
Picture is a recent feature - and a nice addition.
A more cumbersome method:
StringVar EmpID := ToText({ado.EmployeeID},0,"" ) ;
EmpID[1 to 3] + "-" + EmpID[4 to 5] + "-" + EmpID[6 to 9]
Note that the third parameter for the ToText function is the comma separator to use - in this case empty string. This function defaults to using the Windows default comma separator.
The same applies to the second parameter - the number of decimal places - 0 in this case. Malcolm
wynden@telus.net
I'm using the CR version that comes with VB6. The help file has reference to the Picture command but it doesn't seem to exist in the product itself.
As for your solution, unfortunately some numbers start with zero (I'm not sure if that's a valid social security number) but anyway, this formula doesn't like the subscripts used as the length becomes 8 and not 9.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.