Results 1 to 10 of 10

Setting focus on a textbox in userform on Excel VBA

Threaded View

Shanthan Setting focus on a textbox in... 02-23-2013, 06:48 AM
hafizimran Re: Setting focus on a... 02-23-2013, 07:12 AM
Shanthan Re: Setting focus on a... 02-23-2013, 09:31 PM
Shanthan Re: Setting focus on a... 02-23-2013, 10:47 PM
mahaveersomani Re: Setting focus on a... 02-23-2013, 07:23 AM
mahaveersomani Re: Setting focus on a... 02-25-2013, 12:23 AM
Shanthan Re: Setting focus on a... 02-25-2013, 12:18 PM
mahaveersomani Re: Setting focus on a... 02-26-2013, 12:40 AM
Shanthan Re: Setting focus on a... 02-28-2013, 10:41 PM
mahaveersomani Re: Setting focus on a... 03-01-2013, 12:25 AM
  1. #1
    Registered User
    Join Date
    02-09-2013
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    31

    Setting focus on a textbox in userform on Excel VBA

    I have two userforms: frmTradeSickOther and frmOther. When I click "Other" option in frmTradeSickOther, it'll call frmOther. I am trying to get the user to enter some text in a textbox in frmOther and then click on the button "Add Comment". If the user clicks on "Add Comment" button without typing anything in the textbox, a message box will come up telling the user to type something in.

    My Problem: I am trying to get the cursor to automatically go to the top-left corner of the textbox and blink once the user is returned to frmOther after the error message.

    I got the cursor to go to the text box when frmOther is called from frmTradeSickOther by adding the following code (See line 67-71 in the attached file):

    Private Sub optOther_Click()
        Unload Me
        frmOther.Show
        frmOther.txtOther.SetFocus
    End Sub
    Attached Files Attached Files

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1