Results 1 to 4 of 4

AfterUpdate/BeforeUpdate and SetFocus

Threaded View

  1. #1
    Registered User
    Join Date
    05-05-2010
    Location
    Den Haag, Nederland
    MS-Off Ver
    Excel 2007
    Posts
    3

    AfterUpdate/BeforeUpdate and SetFocus

    I have some problems with the SetFocus command in a Userform with an AfterUpdate or BeforeUpdate routine.

    To make it clear to you, I made a very small Userform to demonstrate it. It only contains 8 TextBoxes and this code:
    Private Sub TextBox01_AfterUpdate()
    Me.TextBox08.SetFocus
    End Sub
    -
    Private Sub TextBox02_BeforeUpdate(ByVal Cancel As MSForms.ReturnBoolean)
    TextBox08.SetFocus
    End Sub
    -
    Private Sub TextBox03_Exit(ByVal Cancel As MSForms.ReturnBoolean)
    TextBox08.SetFocus
    End Sub
    -
    Private Sub TextBox04_Change()
    TextBox08.SetFocus
    End Sub
    I expected that in all cases, the focus should be set to TextBox08, but this only happens with the Change event.

    Do you have any suggestions how I can set the focus to TextBox08 in an AfterUpdate or BeforeUpdate event?

    I use Excel 2007

    Kind regards,

    Otto.
    Last edited by Leith Ross; 05-05-2010 at 01:02 PM. Reason: Added Code Tags

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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