Results 1 to 2 of 2
  1. #1
    Danny729 is offline Novice
    Windows 10 Office 365
    Join Date
    Jul 2022
    Posts
    4

    Disable Field for single record


    Okay, so this database has a "status" drop down. I want fields to be enabled when the status is "Pending" but when the status is closed I want all the fields to be disabled.

    My current code is:
    If Me.Status.Value = "Closed" Then
    Me.FieldName.Enabled = False

    This, however, disables the fields across all records. I just want to disable the ability to alter a record once the record is closed.

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,525
    if you use a SINGLE record, then it only affects that 1 record.

    if you are using a CONTINUOUS LIST form, it can only do it to ALL records.
    but if you put the lock code in the form's ON CURRRENT, then moving the cursor to the next record, will unlock all fields if pending, or lock if closed.

    Code:
    Private Sub Form_Current() Me.FieldName.Enabled =Me.Status<> "Closed"
    end sub

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

Similar Threads

  1. Replies: 15
    Last Post: 11-06-2021, 07:16 PM
  2. Replies: 2
    Last Post: 06-12-2019, 05:57 PM
  3. How to disable subform row single field
    By tahirsatti in forum Forms
    Replies: 3
    Last Post: 05-09-2013, 12:07 AM
  4. Replies: 1
    Last Post: 06-05-2012, 04:10 PM
  5. Replies: 9
    Last Post: 12-17-2010, 11:44 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