+ Reply to Thread
Results 1 to 10 of 10

Setting focus on a textbox in userform on Excel VBA

Hybrid View

  1. #1
    Valued Forum Contributor
    Join Date
    09-04-2012
    Location
    india
    MS-Off Ver
    Excel 2007
    Posts
    463

    Re: Setting focus on a textbox in userform on Excel VBA

    ok dear carry on...and if you have any further requirement then you can ask....

    If this was helpful to you then hit on the * button for user reputation...

    Regards
    CA Mahaveer Somani

  2. #2
    Registered User
    Join Date
    02-09-2013
    Location
    Canada
    MS-Off Ver
    2010
    Posts
    31

    Re: Setting focus on a textbox in userform on Excel VBA

    I was able to figure out a way around the issue by disabling the textbox, then enabling it, and then setting focus. Here is the code:

        If Me.txtOther = vbNullString Or Me.txtOther = vbNewLine Then
            Me.Hide
            MsgBox "Please enter the necessary information.", vbInformation, "Required Field"
            frmOther.Show
            Me.txtOther.Enabled = False
            Me.txtOther.Enabled = True
            Me.txtOther.SetFocus
            Exit Sub
        End If

+ Reply to Thread

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