+ Reply to Thread
Results 1 to 4 of 4

Set Focus

  1. #1
    Registered User
    Join Date
    11-29-2009
    Location
    dubai
    MS-Off Ver
    Excel 2003
    Posts
    56

    Set Focus

    hi,

    my user form has 3 text boxes

    Text Box 1 = uf_UserInfo.txt_UI_EmpName
    Text Box 2 = uf_UserInfo.txt_UI_EmpNameID
    Text Box 3 = uf_UserInfo.txt_UI_Dept

    If I use the below code then it works fine,

    Please Login or Register  to view this content.
    However; I cannot get 1 or all 3 criteria's to match. If I use the following code then I get an error? I am sure it is to do with 'SetFocus' method.

    Please Login or Register  to view this content.
    Please help.
    Thanks
    R

  2. #2
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Set Focus

    What is the essence of focus ?
    In optometrics doublefocus can be achieved, in VBA it can't.



  3. #3
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,434

    Re: Set Focus

    as snb points out only one control can have focus.
    You need to check each textbox and deal with the first empty one

    Please Login or Register  to view this content.
    When you use code that check all the textboxes at once you will detect an empty one but you will not know which one to set focus to.
    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  4. #4
    Registered User
    Join Date
    11-29-2009
    Location
    dubai
    MS-Off Ver
    Excel 2003
    Posts
    56

    Re: Set Focus

    Thanks guys..

+ 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