+ Reply to Thread
Results 1 to 6 of 6

Starting Point For Form

  1. #1
    Registered User
    Join Date
    07-15-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    77

    Starting Point For Form

    Hi All

    I have the following code for a user form that works fine, however I am new to userforms & cannot find how to get the cursor to start in the text box that i want, and after the user has submitted the data for it to return to this point. I know its probably being very daft of me but i cannot get the code correct.
    The text box I want as starter point is called TextBoxSurname

    The code at moment is:

    Please Login or Register  to view this content.
    cheers
    Mark
    Last edited by markrennolds; 03-23-2010 at 05:34 PM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Starting Point For Form

    Take a look at SetFocus

    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Registered User
    Join Date
    03-21-2010
    Location
    Adelaide, Australia
    MS-Off Ver
    Excel 2003
    Posts
    13

    Re: Starting Point For Form

    Each input box on the form has a property called "TabIndex" Set these numerically and you should be able to tab through the form from 1 to 11 (or whatever). When the form reloads the cursor should be at the box set as TabIndex1.
    It works for me and I've built a few forms.

    As I'm new there might be a better way to do this, good luck.

  4. #4
    Forum Expert contaminated's Avatar
    Join Date
    05-07-2009
    Location
    Baku, Azerbaijan
    MS-Off Ver
    Excel 2013
    Posts
    1,430

    Re: Starting Point For Form

    Try this

    TextBoxSurname.SetFocus
    Люди, питающие благие намерения, как раз и становятся чудовищами.

    Regards, ?Born in USSR?
    Vusal M Dadashev

    Baku, Azerbaijan

  5. #5
    Forum Expert dominicb's Avatar
    Join Date
    01-25-2005
    Location
    Lancashire, England
    MS-Off Ver
    MS Office 2000, 2003, 2007 & 2016 365
    Posts
    4,867

    Smile Re: Starting Point For Form

    Good evening markrennolds

    From the VBE, with your userform selected, simply go to View > Tab Order.
    A small dialog will poen listing all your controls - just use the buttons to move them up or down until they're in the order that you want. Then whenever a user tabs through your controls, this is the order they'll follow.

    You can also alter the TabIndex property from the properties box, but the above way is miles easier / better / faster etc.

    HTH

    DominicB
    Please familiarise yourself with the rules before posting. You can find them here.

  6. #6
    Registered User
    Join Date
    07-15-2009
    Location
    Manchester, England
    MS-Off Ver
    Excel 2007
    Posts
    77

    Re: Starting Point For Form

    Thanks All as usual

+ 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