How to change the width of a TextBox in Acces form, when button clicked.

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • matrekz42
    New Member
    • Sep 2007
    • 37

    How to change the width of a TextBox in Acces form, when button clicked.

    This may seem extremely simple, but I want to have in VB a code that will change the width of a TextBox when a button in the form is clicked. How can I go about this?
  • mshmyob
    Recognized Expert Contributor
    • Jan 2008
    • 903

    #2
    Use the WIDTH property but you need to use something called TWIPS. 1440 twips is equal to 1 inch (2.25cm)

    In your ON CLICK event of your button

    [code=vb]
    Me.txtBox.Width = 1440 'set your text box to 1 inch
    Me.txtBox.Width = 2880 'set your text box to 2 inches
    [/code]

    cheers,


    Originally posted by matrekz42
    This may seem extremely simple, but I want to have in VB a code that will change the width of a TextBox when a button in the form is clicked. How can I go about this?

    Comment

    • matrekz42
      New Member
      • Sep 2007
      • 37

      #3
      It worked, thanks a million!

      Comment

      • mshmyob
        Recognized Expert Contributor
        • Jan 2008
        • 903

        #4
        You're welcome.

        cheers,

        Originally posted by matrekz42
        It worked, thanks a million!

        Comment

        Working...