Results 1 to 11 of 11
  1. #1
    New Lounger
    Join Date
    Oct 2006
    Location
    Michigan, USA
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Protect Form (Access 2003)

    Hello,
    I need to protect a form from accidental overwriting of the current record. I would like to have them click the Find Record or Add a New Record button in order to allow editing. I can set the form to not allow editing in the properties, but am not sure how to have it allow editing after they click the Find Record button (clicking the Add New Record button seems to allow editing within the form).
    Any ideas - I can zip the file and attach if necessary.

    Thanks,

    Bart

  2. #2
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Protect Form (Access 2003)

    The code

    Me.Enabled = true
    Me.Locked =false

    will remove the protection from the form.

    So if Find Record and Add a New Record buttons are command buttons on your form, you can add this code behind these buttons.
    Regards
    John



  3. #3
    New Lounger
    Join Date
    Oct 2006
    Location
    Michigan, USA
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Protect Form (Access 2003)

    How do I add the code in for the buttons?
    I'm getting an error.

    I'm trying to strip down the database to attach.

  4. #4
    New Lounger
    Join Date
    Oct 2006
    Location
    Michigan, USA
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Protect Form (Access 2003)

    Attached is a copy of database.
    The Master Course Form is where I'm trying to protect the form from accidental overwriting.

  5. #5
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Protect Form (Access 2003)

    Your attachment did not arrive.

    Have you zipped the file to under 100KB?
    Regards
    John



  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Protect Form (Access 2003)

    Locked and Enabled are properties of a control, not of a form.

  7. #7
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Protect Form (Access 2003)

    Have you created the Find Record button yourself? If so, you can add the line

    Me.AllowEdits = True

    in the On Click event procedure of the button.

  8. #8
    Super Moderator
    Join Date
    Jun 2002
    Location
    Mt Macedon, Victoria, Australia
    Posts
    3,993
    Thanks
    1
    Thanked 45 Times in 44 Posts

    Re: Protect Form (Access 2003)

    Oops Careless mistake Sorry.
    Regards
    John



  9. #9
    New Lounger
    Join Date
    Oct 2006
    Location
    Michigan, USA
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Protect Form (Access 2003)

    Thanks folks!

    Hans that worked.
    I thought I attached the database as a zip file - not sure what happened.

    Thanks again,

    Bart

  10. #10
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Protect Form (Access 2003)

    If you specify an attachment, then preview or spell check your post, the attachment box is cleared again. So you must always specify an attachment just before clicking "Post It".

  11. #11
    New Lounger
    Join Date
    Oct 2006
    Location
    Michigan, USA
    Posts
    16
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Re: Protect Form (Access 2003)

    Thanks Hans - that's probably what i did.
    Again, thanks for the help - works great now.

    Bart

Posting Permissions

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