+ Reply to Thread
Results 1 to 3 of 3

Retaining Focus

  1. #1
    Registered User
    Join Date
    04-15-2004
    Posts
    12

    Retaining Focus

    Hi

    I enter data is a Textbox called TxtNewCode and then press "Enter" - the code then updates other TextBoxs on the form



    PHP Code: 
     Private Sub TxtNewCode_Exit(ByVal Cancel As MSForms.ReturnBoolean)

      
    ' Updating the form here
     

    End Sub 


    When I exit the subroutine the Focus is passed to the next control on the form- How can I ensure that after the subroutine is exited that the focus is returned to the TxtNewCode textbox

    Many thanks
    Last edited by John Eakins; 09-28-2007 at 11:14 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258
    Hello John,

    By setting the "Cancel" variable to True. This will prevent the focus from moving automatically to the next control in the Tab sequence.
    Please Login or Register  to view this content.
    Sincerely,
    Leith Ross

  3. #3
    Registered User
    Join Date
    04-15-2004
    Posts
    12

    Retaining Focus

    Hi Leith

    Perfect - many thanks

    John

+ 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