Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Feb 2003
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Allow Edit code (2002/sp3)

    I want to make a button to allow editing in one field on a form.

    The form is called frmStudentData and the field is SS.

    What is the coding to make this happen? I can't seem to get it right.

    Thanks. Paul

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

    Re: Allow Edit code (2002/sp3)

    If you want to allow editing only one field, you should set the Allow Edits property of the form to Yes and the Locked property of all bound controls to Yes in design view. This means that by default, the user won;t be able to edit anything.
    The On Click code should set the Locked property of the control bound to SS to No:

    Private Sub cmdEdit_Click()
    Me.SS.Locked = No
    End Sub

    If you want the field to be locked again when the user moves to another record, you should set it in the On Current event of the form:

    Private Sub Form_Current()
    Me.SS.Locked = True
    End Sub

Posting Permissions

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