Results 1 to 5 of 5

Thread: [RESOLVED] Change event

  1. #1

    Thread Starter
    Member
    Join Date
    May 2007
    Posts
    38

    Resolved [RESOLVED] Change event

    hi i need to disable the enter button if there is no characters typed on the text box and when they type then the enter button becomes enabled. i need to use the change event can someone help me out?
    Last edited by Hack; May 23rd, 2007 at 05:34 AM. Reason: Added RESOLVED to thread title and green resolved checkmark

  2. #2
    PowerPoster RhinoBull's Avatar
    Join Date
    Mar 2004
    Location
    New Amsterdam
    Posts
    24,132

    Re: Change event

    Would this work for you?
    Code:
    'to ignore spaces use this
    Private Sub Text1_Change()
        Command1.Enabled = CBool(Len(Trim(Text1.Text)))
    End Sub
    
    'or if space is a valid character for you then use this
    Private Sub Text1_Change()
        Command1.Enabled = CBool(Len(Text1.Text))
    End Sub

  3. #3
    Addicted Member
    Join Date
    Mar 2007
    Posts
    183

    Talking Re: Change event

    If the above code doesn't work for you, set the button's Enabled value to False and copy and paste the following code into the Code window:

    [VBCODE]
    Private Sub txtYourTextBox_Change()
    'enable the Enter button
    Enter.Enabled = True
    End Sub
    [/VBCODE]

    Happy to help you!

  4. #4
    Addicted Member
    Join Date
    Mar 2007
    Posts
    183

    Re: Change event

    that probably would not work.

  5. #5

    Thread Starter
    Member
    Join Date
    May 2007
    Posts
    38

    Re: Change event

    thx guys it worked.!!!

Posting Permissions

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



Click Here to Expand Forum to Full Width