Results 1 to 6 of 6
  1. #1
    sissavior is offline Novice
    Windows 8 Access 2016
    Join Date
    Oct 2018
    Posts
    6

    Question Password to delete a record

    Hello everyone,

    We are currently using an access database on a computer with multiple users, so we are trying to set a password for Deleting a record from a table (if possible, also for modifying a previous record too).

    Is this possible?

    Thank you!


  2. #2
    ranman256's Avatar
    ranman256 is online now VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,521
    I ask user for password in a form box
    the recordID to delete picked in another box (combo)

    check to see if password correct,

    Code:
    if me.txtPass = gvPassword then
      on error resume next
      docmd.openquery "qdDelete1Rec
    endif

  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
    Just to be clear, you cannot prevent users deleting or modifying records in a table (unless its made read only) if they are able to access the tables.
    For that reason end users should never have direct access to tables.
    Hide the navigation pane so all interaction is via forms.
    Then you could do something like Ranman suggested (using a password input mask) on a form.
    But do you really need to delete records. A better solution might be a Boolean field Active that is true by default but is set false to 'archive' the record.
    If its needed in the future the Active field can be reset to true
    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
    sissavior is offline Novice
    Windows 8 Access 2016
    Join Date
    Oct 2018
    Posts
    6
    I think I get the idea. Thank you very much for the help.

  5. #5
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,737
    A better solution might be a Boolean field Active that is true by default but is set false to 'archive' the record
    I prefer some other indicator, such as a date. If Null it's not archived but a date not only archives it, it gives an idea of when. Seeing as how this thread seems to be about passwords during a shared login, a piece of user id might be even better than a date - like ArchivedBy.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  6. #6
    isladogs's Avatar
    isladogs is offline MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    5,954
    As Micron suggests I often use a field such as LeavingDate to denote archived records with the value set to Null whilst the record is active.
    If so the Boolean field I suggested is no longer needed.
    Both methods work

    Also rather than require a password, you can set the whole form or individual control to be read only for standard users but editable by those with admin rights
    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

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

Similar Threads

  1. Replies: 4
    Last Post: 09-03-2019, 09:09 AM
  2. Replies: 13
    Last Post: 05-06-2014, 12:42 PM
  3. password to be able to delete the record
    By azhar2006 in forum Forms
    Replies: 3
    Last Post: 02-18-2014, 03:31 PM
  4. Replies: 4
    Last Post: 07-03-2013, 10:02 AM
  5. Trying to Delete record using delete query
    By MooseOTL in forum Access
    Replies: 13
    Last Post: 10-04-2011, 02:30 AM

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