Hide / Mask Address field on form if you did not create the record. (1 Viewer)

tucker61

Registered User.
Local time
Yesterday, 16:49
Joined
Jan 13, 2008
Messages
265
I have just created a subform which contains users Contact Name, Number and Address.

I want to hide / Mask the address / Number (GPDR) unless it is a record you have created, so thinking about pulling back the username and then comparing against the person who is logged in, but cant decide on best way to hide the data.

I dont want it to be a ".Visible = False", would prefer if it was just "********"

What is the best way to do this ?
 

theDBguy

I’m here to help
Staff member
Local time
Yesterday, 16:49
Joined
Oct 29, 2018
Messages
17,113
Hi. Maybe you could change the InputMask to Password?
 

The_Doc_Man

Immoderate Moderator
Staff member
Local time
Yesterday, 18:49
Joined
Feb 28, 2001
Messages
21,149
Your solution requires TWO things. First, you must know the USERID of the person who created the record. Second you must know the USERID of the person viewing the record. Then you can put some event code in the Form_Current routine to make that comparison. OR... since the subform is the thing in question, you could have the parent form ALWAYS set the child form's fields to mask, then have the sub-forms's Current routine to decide whether to UNMASK the fields in question. TheDBguy's suggestion of using a password mask should be just right either way you do it.
 

tucker61

Registered User.
Local time
Yesterday, 16:49
Joined
Jan 13, 2008
Messages
265
Thanks as Allways.

Currently I have coded looking at the environ(username) and made the field visible=false

Tomorrow I will look at how to format as password using vba..

Cheers both
 

Users who are viewing this thread

Top Bottom