Results 1 to 10 of 10
  1. #1
    lauralu82 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2018
    Posts
    5

    Question Masking specific data question

    Is there a way to mask certain data in a field based on the data in another field? For example - if I have an employee flag field and that field is not null, i would like the employees name masked in the name field. If the employee flag field is null, the name can show. I tried expression builder with no success. I am a somewhat Access newbie but picking up things as I go - any help I can get I will greatly appreciate!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    lauralu82 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2018
    Posts
    5
    Yes something like that seems like what I need.

  4. #4
    lauralu82 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2018
    Posts
    5
    Preferably if the employee flag field is not null I would like "XXXXX" or something similar to appear in the name field.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    You can set the InputMask property appropriately instead of visible.

    Me.ControlName.InputMask = "Password"
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    lauralu82 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2018
    Posts
    5
    Here is the current last line of this query with what I tried to add myself based on your help. It gives a syntax error. Im sure it is something simple - maybe with the parentheses? Or am I completely wrong?
    HAVING (((SQLUser_LN_ACCT.nxt_due_dt) Is Not Null))
    If SQLUser_MEMBER_ACCT.emp_cd = Is Null Then
    SQLUser_MEMBER_ACCT.mbr_nam = True
    Else
    SQLUser_MEMBER_ACCT.mbr_name.InputMask = "Password"
    End If;

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    The HAVING line is SQL, doesn't belong in this code unless I'm completely misunderstanding what you're doing. I would expect the If clause to set the input mask to "".
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    lauralu82 is offline Novice
    Windows 7 64bit Access 2016
    Join Date
    Jul 2018
    Posts
    5
    That is additional criteria needed to narrow down the report. I originally put that in under Criteria in Design View. I need that as well as the Name Masking. That part works, I just need the masking code to be worked in which I am not sure how to do.

  9. #9
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Is Null is SQL; in VBA you'd use the IsNull() function.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  10. #10
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    Preferably if the employee flag field is not null I would like "XXXXX" or something similar to appear in the name field.
    If you mean temporarily, then you cannot do this if the form field is bound, otherwise to do so would change the data in the table. You would need a duplicate of the name field, except the dupe would be unbound and the bound control hidden. The value in the unbound field would be altered by code.

    If you are attempting to modify the appearance of data in a table itself, then that is what I'd consider to be the underlying problem since you should not be exposing tables to users or working on them directly as a matter of normal procedure. In that case, you might simply apply encryption on the field and decrypt (or not) in a form based on the value of your check field. At least that's my take FWIW.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 9
    Last Post: 05-16-2018, 12:11 PM
  2. Data Masking with SQL Server 2016
    By Analyst226 in forum SQL Server
    Replies: 0
    Last Post: 07-13-2017, 01:51 PM
  3. Replies: 1
    Last Post: 01-13-2014, 02:47 PM
  4. concatenation for a field, keeping the masking data
    By finsmith in forum Programming
    Replies: 11
    Last Post: 01-26-2013, 04:26 AM
  5. Replies: 1
    Last Post: 01-21-2013, 02:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums