Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2024
    Posts
    2

    Me.AllowEdits = False not working for me


    I have a form with a button, the button should toggle editing of the form, by default the form is set to allowedits No, when I click the button it works, I can edit. When I click the button again, I can still edit where did I go wrong?
    // I added a message box to see the value of allow edits. It seems to be toggling between true and false, but I can always edit after pressing the button!

    Code:
    Private Sub BtnEditStock_Click()
    
    
    Me.AllowEdits = Not Me.AllowEdits
    
    
    Dim myvar As Boolean
    Dim ans
    myvar = Me.AllowEdits
    ans = MsgBox(myvar, vbOKOnly)
    
    
    
    
    End Sub

  2. #2
    Minty is offline VIP
    Windows 10 Office 365
    Join Date
    Sep 2017
    Location
    UK - Wiltshire
    Posts
    3,003
    It might be to do with the fact that the record you are on, possibly has unsaved edits, so it can't disable them at that point?
    This is a speculative guess rather than a definitive answer.
    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
    Join Date
    Feb 2024
    Posts
    2
    I added a form refresh, and it worked.

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

Similar Threads

  1. Replies: 5
    Last Post: 02-03-2022, 10:20 AM
  2. True/false looping only showing the false.
    By Ultimateneo in forum Queries
    Replies: 3
    Last Post: 02-09-2021, 11:41 AM
  3. Replies: 11
    Last Post: 03-14-2019, 09:30 PM
  4. Replies: 1
    Last Post: 02-21-2018, 10:18 AM
  5. Form combo box not working with AllowEdits = False
    By jgelpi16 in forum Programming
    Replies: 3
    Last Post: 02-04-2011, 05:08 PM

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