OK Tototootoo . . .
For testing create a blank form:
[ol][li]From the forms window click [blue]New[/blue]. When the wizard starts select [blue]Design View[/blue].[/li]
[li]Save the form and give it a name but stay in design view.[/li]
[li]Click the properties toolbar button
to bring up the properties window (if its not already open).[/li]
[li]In the properties window click the [blue]Other[/blue] tab.[/li]
[li]Add a textbox to the form and set the name property to [blue]SSN[/blue] (no quotations).[/li]
[li]Add another textbox to the form and set the name property to [blue]Answer[/blue].[/li]
[li]Add a Command Button to the form and when the wizard starts click [blue]cancel[/blue].[/li]
[li]Make sure the buttons is selected then select the [blue]events[/blue] tab of the properties window.[/li]
[li]Put the cursor on the [blue]On Click[/blue] event line then click the three elipses
just to the right.
If a [blue]Choose Builder[/blue] dialog opens select [blue]Code Builder[/blue] and click OK.[/li]
[li]Your now in the code module for the form and the cursor is in the click event of the button. Copy/paste the following where the cursor is in the event:
Code:
[blue] Me!Answer = CipherSSN(Me!SSN)[/blue]
[/li]
[li][blue]Alt + Q[/blue] to return to form design view.[/li]
[li]Save & close the form[/li]
[li]Open the form[/li][/ol]
Enter an SSN in the SSN textbox and hit the button. The cypher should show in the answer textbox.
Enter the cypher in the SSN textbox and the answer should be the SSN . . .
You can now convert ssn's/ciphers back and forth giving you the power to hide your ssn's until you need to view the actual values . . .
See Ya! . . . . . .
Be sure to see FAQ219-2884: