Results 1 to 6 of 6
  1. #1
    aonsu209 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2014
    Location
    Rotterdam
    Posts
    24

    How to temporary lock form for editing


    Dear all,
    I need advice what is the best way to lock form for editing. In the database that Im building I want to restrict editing form for certain time.Below you can see scheme of how the database is build. Click image for larger version. 

Name:	access1.jpg 
Views:	15 
Size:	82.9 KB 
ID:	19323How you can see from the scheme the red circle is where I want to temporarily disable the relationship. Im thinking for event when you open the admin form for checking to restrict employees form or some time event.
    What you will suggest me and how?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    You could certainly do something like:

    Code:
    If SomeConditionIsMet Then
      DoCmd.OpenForm...
    Else
      MsgBox "You can't open that form because..."
    End If
    I'm not really clear on what your condition is though.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    aonsu209 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2014
    Location
    Rotterdam
    Posts
    24
    Quote Originally Posted by pbaldy View Post
    You could certainly do something like:

    Code:
    If SomeConditionIsMet Then
      DoCmd.OpenForm...
    Else
      MsgBox "You can't open that form because..."
    End If
    I'm not really clear on what your condition is though.
    Something like that, but not only a message but also a restriction of the form itself. is it possible something like that

    If Me.ControlName > "" Then
    Me.Form.Enabled = False
    Else
    Me.Form.Enabled = True
    End If

    And the controlname can be check box which Admin can check after open her form with command "check all".
    Thanks

  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
    Forms don't have the Enabled Property. You can use

    Me.AllowEdits = False

    Linq ;0)>
    The problem with making anything foolproof...is that fools are so darn ingenious!

    All posts/responses based on Access 2003/2007

  5. #5
    aonsu209 is offline Novice
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2014
    Location
    Rotterdam
    Posts
    24
    Perfect this is what I've looking for.
    Thank you!

  6. #6
    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
    Glad we could help!

    Good luck with your project!

    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: 3
    Last Post: 10-19-2013, 10:21 AM
  2. lock the editing of combobox text
    By Grooz13 in forum Forms
    Replies: 14
    Last Post: 10-23-2011, 02:08 PM
  3. Replies: 1
    Last Post: 07-18-2011, 03:08 AM
  4. Lock Record for Editing on a Linked table
    By khalid in forum Programming
    Replies: 3
    Last Post: 06-14-2011, 08:37 AM
  5. Replies: 0
    Last Post: 03-26-2007, 12:24 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