Results 1 to 12 of 12
  1. #1
    ljcuellar is offline Novice
    Windows 10 Access 2016
    Join Date
    Sep 2021
    Posts
    1

    How do I mask or replace sensitive data returns?

    I have a query that can return sensitive data in specific columns. I am looking to mask or replace the data (with Confidential) in one of the other columns. If the sensitive data indicator is returned in one column, I would like to mask the data or replace the data (Confidential) in a different column. All other data in other columns can be displayed. First time posting, hopefully this makes sense. Thank you.

  2. #2
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,792
    I suppose a calculated query field would work. Give it an alias name and use IIF function to return either the data or "Confidential". Assuming that the indicator is True or False, perhaps

    ALIAS: IFF([indicator]=False,[dataField],"Confidential")

    If users are directly interacting with queries that's the first thing you should fix. Should only use forms/reports.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  3. #3
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    To mask, you could use the Password format?

    Code:
    tt=12345
    ? tt
     12345 
    ? format(tt,"Password")
    Pa006or20
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  4. #4
    orange's Avatar
    orange is online now Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    Who has to see these confidential values? There may be an/some options to restrict access to these.
    A separate table with 1:1 relationship and user access control to specific accounts.
    We really need to understand the requirements in order to offer more focused responses.

    You may be able to devise an Encrypt and Decrypt set up, but details of your needs are needed.
    Last edited by orange; 09-21-2021 at 11:24 AM. Reason: added link that may be helpful

  5. #5
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,792
    WGM, you would want to be very careful that you didn't use that in a way that will alter the data even if you could get it to work in a query.
    If you can, please post an example of the syntax as I couldn't do it.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    I just tried it out in the immediate window, to see if it would work?
    Code is in post 3
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  7. #7
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,792
    Quote Originally Posted by Welshgasman View Post
    I just tried it out in the immediate window, to see if it would work?
    Code is in post 3
    I can see that. I'm asking if you can do it in a query because the OP is using one. I tried but cannot.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  8. #8
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Just a quick query
    Code:
    SELECT TestTransactions.Amount, Format([Amount],"""Pa""ssw""or""d") AS Expr1
    FROM TestTransactions;
    Something strange going on here. I keyed in Format([Amount],"Password"), yet Access changed it to above. I removed the second column and tried again, same thing?

    In fact just using "*********" will mask the contents?
    Attached Thumbnails Attached Thumbnails Password.PNG  
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  9. #9
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    This is interesting
    Code:
    SELECT TestTransactions.Amount, Format([Amount],"""*******""") AS Expr1, Format([Amount],"c\on""fi""d\en""tial""") AS Expr2
    FROM TestTransactions;
    I just entered "Confidential" as the format?
    Attached Thumbnails Attached Thumbnails Confidential.PNG  
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  10. #10
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    I am wondering, why not just omit the confidential data?
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  11. #11
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,974
    End users should NEVER look at tables or query results.
    All interaction should be done via forms or reports.

    For fields with confidential data on reports, you can easily make that data 'invisible' using conditional formatting where the text colour (fore colour) is set equal to the back colour.
    OR you can mask it using the IIf function as Micron mentioned in post #2 (NOTE: IIf NOT Iff)

    @Welshgasman
    As I think you've already realised, you can't use formatting for this purpose
    Colin, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I don't know, I keep quiet!
    If I don't know that I don't know, I don't know whether to answer

  12. #12
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,792
    The difference seems to be that when I saw what Access did to the format parameter (as you posted) I didn't even try to run it, figuring it wouldn't work. Thread seems to be morphing into formatting quirks. As for me, I think I will refrain from commenting until OP responds to Orange.

    EDIT - Yes, IIF. That was before and after a rough night.
    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. Case Sensitive Data
    By VLPOTTER in forum Access
    Replies: 1
    Last Post: 04-28-2021, 09:31 AM
  2. Changing Sensitive Data to Upload Here
    By cew75 in forum Access
    Replies: 5
    Last Post: 01-05-2019, 10:25 AM
  3. Replace Carriage Returns with Spaces
    By chitan in forum Queries
    Replies: 1
    Last Post: 12-15-2011, 11:14 AM
  4. Custom Data input mask or format?
    By RiverAnimal in forum Database Design
    Replies: 2
    Last Post: 12-06-2010, 09:58 AM
  5. Time sensitive data
    By ViRi in forum Forms
    Replies: 3
    Last Post: 02-27-2010, 01:04 AM

Tags for this Thread

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