Results 1 to 4 of 4

Thread: Allow Edits

  1. #1
    Join Date
    May 2004
    Posts
    17

    Unanswered: Allow Edits

    I have a form in which the records can not be edited. At times, certain records need to be changed. I want to create a command button that allows only the selected record to be changed. Any suggestions.

  2. #2
    Join Date
    Jun 2004
    Posts
    55
    Well the best way I think about doing it right now is to make a golbal variable let's call it EditOn. Then in the timer event do:

    If Not EditOn = Me.CurrentRecord then
    Me.AllowEdits = False
    End If

    and in the button code say

    EditOn = Me.CurrentRecord
    Me.AllowEdits = True

  3. #3
    Join Date
    Dec 2003
    Location
    Dallas, TX
    Posts
    1,004

    Cool

    I had a similar way also. For your form go to the Form, Properties, DataTab and set AllowEdits to NO. Next, create a CommandButton, without the wizard, and then go to the Properties of the CommandButton, click on OnEvent then click on CodeBuilder (...) In there you simply put: Me.AllowEdits = True

    Oh, in the Form's Properties on the AfterUpdate Event click on the CodeBuilder again and type this: Me.AllowEdits = False

    Now when your form opens it can't be Edited until you click on the CommandButton, labeled something like EDIT RECORD. Once you finish that record and tab out of it you automatically go back to a Non-Editable form. OR create a CommandButton to set it to Save the record on demand and set the AllowEdits = False there.

    Now you have a couple of ways to do the same thing.

    have a nice weekend to you and all on here,
    BUD

  4. #4
    Join Date
    May 2004
    Posts
    17
    It works. Thank you very much. Have a great weekend.

Posting Permissions

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