Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 2004
    Posts
    14

    Unanswered: Unlocking Controls

    I have a form that displays info with all of the controls locked to prevent modification. I want to add a button to permit editing. Does anyone have a function that will unlock all controls on a form. I know I can list them all out and enable them but it is a long list.....

    Thanks
    Keith

  2. #2
    Join Date
    Apr 2004
    Location
    Kingsland, Georgia
    Posts
    231

    Re: Unlocking Controls

    Originally posted by kschuster
    I have a form that displays info with all of the controls locked to prevent modification. I want to add a button to permit editing. Does anyone have a function that will unlock all controls on a form. I know I can list them all out and enable them but it is a long list.....

    Thanks
    Keith
    how about something like this?
    Code:
        Dim ctlTemp As Control
        For Each ctlTemp In Me.Controls
            If ctlTemp.Enabled = False Then
                ctl.Enabled = True
            End If
        Next ctl
    that should make sure they are all unlocked. if you just want to unlock textboxes or something, you could change the one line to
    Code:
    If ctlTemp.ControlType - acTextBox Then
    etc...good luck

Posting Permissions

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