>>
>>What is your UI like? Do you have a method that you use to display the current record? If so, decrypt it there, then in your save code encrypt it there. Did you try the control's refresh method for decrypting it?
> well, thanks, I was looking for a way to create a control which could be used anywhere.
>But I guess not.
>
>Peter
Ah, I didn't understand that. I guess as you have seen using the Got/LostFocus won't really work, however you could probably get it to work in another way.
If you add some properties like:
EncryptDecryptThis logical
FieldToEncrypt character
don't bind the control to a field.
then in the refresh of the control call the decrypt code and set the control's value to the decrypted text and in the lostfocus of the control call the encrypt code and then manually set the field to the encrypted value.
That's off the top of my head, but should set you on the right path.