Disabling fields

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KingKen
    New Member
    • Feb 2008
    • 68

    Disabling fields

    I have created a form with a few tabs for data entry. The first tab contain fields that i want to disable after data is entered and saved. that is a person comming after to enter data into that form should not be able to change the data they meet. the fields on the tab are combo boxes and and text boxes.
    please help
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32662

    #2
    There are various properties for each control (fields are items in a record - controls are items on a form or report). Check out the Locked and Enabled properties for what you want.

    Comment

    • KingKen
      New Member
      • Feb 2008
      • 68

      #3
      I cannot use that since i do want people to enter data in the fields iniatially. what i want is for them not to be able to change the data after they would have move to a new record, nor should they be able to alter something that someone else had entered in those fields.

      Comment

      • missinglinq
        Recognized Expert Specialist
        • Nov 2006
        • 3533

        #4
        NeoPa's advice is the only way you can do this, if, as your post suggests, you want to be able to view existing records as well as add new records! You simply have to use the properties conditionally. If , when moving to a record, a field already has data in it, lock it. Otherwise, leave it unlocked.

        [CODE=vb]Private Sub Form_Current()
        If Not IsNull(Me.TextB oxName) Then
        TextBoxName.Loc ked = True
        Else
        TextBoxName.Loc ked = False
        End If
        End Sub[/CODE]

        Welcome to TheScripts!

        Linq ;0)>

        Comment

        • KingKen
          New Member
          • Feb 2008
          • 68

          #5
          Dear wizzard of this barn
          It worked like a charm
          did no harm
          once again I can yarn
          thanks for the helping arm

          Linq

          Comment

          • NeoPa
            Recognized Expert Moderator MVP
            • Oct 2006
            • 32662

            #6
            Nice to have some poetry in here :)
            BTW I edited your post as you seemed to be signing it as Linq rather than addressing it to him (that is his signature rather than his handle when done with the smiley).

            Comment

            Working...