Results 1 to 4 of 4
  1. #1
    Hasse is offline Novice
    Windows 8 Access 2013
    Join Date
    Jan 2014
    Posts
    2

    How do i lock and unlock data edition i my form with a bottomcontrol.


    I want to prevent accidental modifications of items of data in my form.
    It is easy to preset the mode for read only in the properties window but i want to change the mode
    betwen "read only" and "alow edit" with a function-bottom.
    Can it be done?

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Yes. Code can set the form properties: AllowEdits, AllowDeletions, AllowAdditions.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  3. #3
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Here is a basic example of using controls on a main form to manage some of the properties on a subform.
    https://www.accessforums.net/sample-...tml#post190509

  4. #4
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    Code can set the form properties: AllowEdits, AllowDeletions, AllowAdditions.
    Like this, where the Command Button is named cmdAllowEdits:

    Code:
    Private Sub Form_Current()
     Me.AllowEdits = False
    End Sub
    
    Private Sub cmdAllowEdits_Click()
     Me.AllowEdits = True
    End Sub
    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

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

Similar Threads

  1. Replies: 7
    Last Post: 06-14-2013, 09:47 AM
  2. Unlock Access VBA
    By jhargram in forum Access
    Replies: 0
    Last Post: 03-01-2012, 05:06 AM
  3. Replies: 4
    Last Post: 01-23-2011, 09:01 PM
  4. Replies: 0
    Last Post: 07-10-2010, 08:11 AM
  5. Replies: 0
    Last Post: 03-08-2009, 05:12 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