+ Reply to Thread
Results 1 to 3 of 3

Form field focus

  1. #1
    Registered User
    Join Date
    Newcastle, Australia
    MS-Off Ver
    Excel 2010

    Form field focus

    I am opening a form with a button using following code:

    Please Login or Register  to view this content.
    This works fine. It opens with no focus in any fields. I want then when it opens for the focus to be in the first field. I thought if there wasn't code specifically for it, I could send keystrokes to Tab (which works to put cursor in second field), the shift+tab to bring cursor back to first field?
    Last edited by Leith Ross; 07-09-2013 at 10:03 PM. Reason: Added Code Tags

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010

    Re: Form field focus

    Hello Nathan323,

    Any control on the Form that can take the "focus" will be selected when the user form is displayed. To control the order of which control will receive focus first then you need to set the Tab Order of the controls on your form. You can do this by changing the TabIndex property of the control.
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.

    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Forum Expert Solus Rankin's Avatar
    Join Date
    Hollywood, CA
    MS-Off Ver
    Win7 Office 2010 VS Express 2012

    Re: Form field focus

    You can also try to add this after DropOffUserForm.Show

    Please Login or Register  to view this content.

    Please remember the following:

    1. Use [code] code tags [/code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    Highlight the code in your post and press the # button in the toolbar.
    2. Show appreciation to those who have helped you by clicking below their posts.
    3. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

    "Slow is smooth, smooth is fast."

+ Reply to Thread

Thread Information

Users Browsing this Thread

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


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