Results 1 to 5 of 5
  1. #1
    domivax is offline Novice
    Windows 7 64bit Access 2013
    Join Date
    Apr 2014
    Posts
    7

    Anonymize a string with ***

    Dear All,

    Because the new Data Protection Law, I need to find a function to anonymize the name of my clients like the following:

    SYDNEY COLLARD => SY*** CO*****
    KEVIN MICHAEL TRUMP => KE*** MI***** TR***
    MARY ST-JAMES => MA** ST******


    NICOLE RODGERS => NI**** RO*****
    ROGER PENA => RO*** PE**
    etc...

    Thank you for your help.

    Best Regards,
    Domivax

  2. #2
    Minty is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,001
    I wouldn't try and annonmise it, simply replace it with a completely random string.
    It wouldn't take many random repeats of random bits of the same length strings to work out the real name.

    There is a function here https://access-programmers.co.uk/for...d.php?t=296410 that will possibly help.
    DLookup Syntax and others http://access.mvps.org/access/general/gen0018.htm
    Please use the star below the post to say thanks if we have helped !
    ↓↓ It's down here ↓↓

  3. #3
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    Another method you can use if you want to anonymise reports containing sensitive data is to either make the name fields hidden or use a white font colour which amounts to the same thing. I use that for reports used in public meetings
    I have a checkbox on the calling form. Ticked = anonymise.
    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

  4. #4
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,397
    in the medical world they use a patientID which is just a unique number or a unique random combination of letters and numbers assigned to a patient, their name or other personal data is never used.

  5. #5
    davegri's Avatar
    davegri is offline Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,388
    This will work if each name part can be passed as a separate argument.
    If first, last and middle are all in the same field, with middle being optional, then more code required.
    What happens if middle is just a single initial? Code below requires all names to be longer than 2 characters.

    Code:
    Public Function fcnAnon(arg As String) As String
        Dim L As Integer
        Dim i As Integer
        Dim rslt As String
        L = Len(arg)
        If L > 2 Then
            rslt = Left(arg, 2)
            For i = 3 To L
                rslt = rslt & "*"
            Next i
        End If
        fcnAnon = rslt
    End Function

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

Similar Threads

  1. Replies: 5
    Last Post: 06-15-2018, 03:14 PM
  2. Replies: 5
    Last Post: 02-20-2018, 07:25 PM
  3. Using A String Literal In Query String
    By Juan4412 in forum Programming
    Replies: 1
    Last Post: 05-24-2017, 08:45 AM
  4. Replies: 6
    Last Post: 06-20-2016, 01:29 PM
  5. Replies: 2
    Last Post: 04-05-2015, 06:06 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