Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2015
    Posts
    23

    Unanswered: Disabling Single Record

    Good day, Please i need help on how to disable or make a single record (form) inactive in ms access. thanks

  2. #2
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    629
    Provided Answers: 34
    Lock the form.
    Me.locked = true

  3. #3
    Join Date
    Jan 2015
    Posts
    23
    Thanks for your quit response. This reply @ranman256 will lock the entire form or specified fields.
    This is exactly what i need:- I have a form of about 20 fields with about 200 records. Some of the people among the 200 records do not exist anymore (resigned, dead, transferred etc) but i don't want to delete them. So i need a code that will disable or make only these specific records inactive using a criteria from the a field called "Status". Status has a drop down "Active" and "Inactive". e.g, say
    "If Me.Status = "Inactive" Then
    ------------------------------------------
    I don't want to lock the entire form. Also, i prefer to disable or change backcolor of those records rather than lock. Thanks in anticipation.

  4. #4
    Join Date
    Feb 2004
    Location
    New Zealand
    Posts
    1,482
    Provided Answers: 11
    have you tryed


    If Me.Status = "Inactive" Then
    Me.locked = true
    else
    Me.locked = false
    end if


    now where to put it we want to check it on each record to i would put it in the Form_Current()
    hope this help

    StePhan McKillen
    the aim is store once, not store multiple times
    Remember... Optimize 'til you die!
    Progaming environment:
    Access based on my own environment: DAO3.6/A97/A2000/A2003/A2007/A2010
    VB-NET based on my own environment started 2007
    SQL-2005 based on my own environment started 2008
    YOUR PASSWORD IS JUST LIKE YOUR TOOTHBRUSH DON'T SHARE IT.
    DONT WORRY ABOUT THOSE WHO TALK BEHIND YOUR BACK
    THEY'RE BEHIND YOU FOR A REASON

  5. #5
    Join Date
    Nov 2016
    Posts
    3
    If it would help to not see them you can filter them out with a query. depending on the form, maybe a subform that would show just the "inactive" names if they need to be visible. This subform could have the fields locked.

  6. #6
    Join Date
    Aug 2006
    Posts
    132
    Provided Answers: 1
    My solution to this was to place a field in the table (call it Disable, or something), text, 20 char. You could use Yes/No but I wanted text so I could capture a 1,2 word reason for the Disable. In each query add the condition Is Null or "" to the Deleted field. The second condition "" is there in case someone enters text and then simply erases it leaving a zero-length non-Null. On the form where it appears, I colored the field Red if anything was typed in the field to make it noticed.
    PGT

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •