how to lock a box in a form?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • removefromp
    New Member
    • Sep 2007
    • 5

    how to lock a box in a form?

    Hi all,

    I have an user_form in excel that lets the users input and modify data, which will be stored in an access database. There's one box in this form that I would let the users enter data in, but I would like to lock this box so that it can not be modified when the form is reopened.

    Does anyone know the VB codes to lock a box on a user_form? or how else can I approach this issue? any suggestion is greatly appreciated.

    Thanks in advance for your help.
  • BlackMustard
    New Member
    • Aug 2007
    • 88

    #2
    Originally posted by removefromp
    Hi all,

    I have an user_form in excel that lets the users input and modify data, which will be stored in an access database. There's one box in this form that I would let the users enter data in, but I would like to lock this box so that it can not be modified when the form is reopened.

    Does anyone know the VB codes to lock a box on a user_form? or how else can I approach this issue? any suggestion is greatly appreciated.

    Thanks in advance for your help.
    I think what you're looking for is the Enabled property. When the form is reopened, simply set txtTextBox.Enab led = False, and the user will not be able to change its contents.

    If you want to hide it as well as making it unchangeable, use txtTextBox.Visi ble instead.

    Comment

    • removefromp
      New Member
      • Sep 2007
      • 5

      #3
      Originally posted by BlackMustard
      I think what you're looking for is the Enabled property. When the form is reopened, simply set txtTextBox.Enab led = False, and the user will not be able to change its contents.

      If you want to hide it as well as making it unchangeable, use txtTextBox.Visi ble instead.
      Thanks very much. txtTextBox.Enab led works perfectly. appreciate it. ^_^

      Comment

      • csenasa
        New Member
        • Sep 2007
        • 10

        #4
        Originally posted by removefromp
        Thanks very much. txtTextBox.Enab led works perfectly. appreciate it. ^_^

        try this out,

        txtTextBox.lock ed = true
        this also does the same job.

        .enabled works fine, but try this and check, does it make any difference..

        happy learning..
        :-)

        Comment

        Working...