+ Reply to Thread
Results 1 to 4 of 4

Tab order & form population question -workbook included-

  1. #1
    Registered User
    Join Date
    02-14-2017
    Location
    Dublin
    MS-Off Ver
    2010
    Posts
    10

    Thumbs up Tab order & form population question -workbook included-

    Hi,

    So as of late I've been trying to get familiar with programming in excel for the workplace and just basically learning the ins and outs in general, currently I am working on my own little projects, one of which I have attatched

    The goal of my tool is to create a tool to allow users to take notes in as little keystrokes as possible,

    First question how do I control which textbox will the cursor tab to next? As far as I'm aware this is controlled by the order in which the textbox's are added to the form, if there are any other ways please advise.

    The second question is, so I have the forms populating in the final textbox, however, if I don't fill a textbox the label still posts to the textbox, can anybody advise on how I could develop it so that if the textbox is not completed then the label will not post to the note?

    Thank you to anyone that can help me and if anyone has any questions to ask re the same please do
    Attached Files Attached Files
    Last edited by diskin8; 02-25-2017 at 12:06 PM. Reason: edit title as per advice.

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: 2 questions :) -workbook included-

    Controls have a 'TabIndex' property. This defines the order they will be accessed. It is autopopulated when you add controls to the userform, starting at 0 for the first. Each additional control is numbered sequentially.

    You can change the TabIndex by clicking on each control in turn and setting the value manually in the Properties Window (Press F4 if not visible).

    But that's a royal PITA if you have more than a few controls.

    If you click on the first control, then CTRL Click on the remaining control in the order you want, press F4 when you've clicked on them all and enter a 0 in the TabIndex then they will be autonumbered in the order you clicked on them.

    To extend that a little, I'm sure you've seen the ALT-(Letter) quick key combinations to quickly select a control - this is done by using a Label and another control.

    For example add 2 labels and 3 textboxes to a new userform. Name the first textBox txtAddress and the 2nd txtName. The 3rd textbox is only there to allow focus away from the other 2.

    Arrange them neatly. txtName above txtAddress above the 3rd box. Align the 2 labels opposite txtName & txtAddress - set the label captions to 'Name' and 'Address'.

    Now click on the label opposite txtName then, while holding down the CTRL key, click txtName, Address label and txtAddress and the 3rd textbox in that order. Press F4 and enter 0 for the TabIndex. Now add 'N' as the Accelerator for the Name label and 'A' for the address label.

    Sounds a little convoluted, but it's really simple.

    Run the user form. Select the 3rd textbox and press the Alt key. The 2 labels will display an underscore below the 'N' & 'A' characters - pressing Alt-N will go directly to the Name box, Alt-A will go to the Address box.

    On a phone so can't view your worksheet so I'll pass on the second query...

    You may want to edit your thread title. The Moderators here like to see titles that summarizes your problem, a general title like '2 questions...' is frowned on, generally.
    Last edited by cytop; 02-24-2017 at 09:20 AM. Reason: Corrected misnamed property TabOrder...

  3. #3
    Registered User
    Join Date
    02-14-2017
    Location
    Dublin
    MS-Off Ver
    2010
    Posts
    10

    Re: Tab order & form population question -workbook included-

    Thank you for your reply, you have been very informative I understand completely.

    Now if someone can help me with my second queery it would be great.

  4. #4
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: Tab order & form population question -workbook included-

    It's a simple check that the textbox is not blank
    Please Login or Register  to view this content.
    See also comments in the procedures NewNoteButton_Click, which has 2 alternatives for clearing controls, and TextBox12_Change - the Create Note button will only be enabled when there's something to copy in TextBox12. Just a little user interface feature. Why have something enabled when there's nothing for it to do and also provides feedback to the user that the function is not available.
    Attached Files Attached Files
    Last edited by cytop; 02-24-2017 at 09:07 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 12-16-2013, 05:16 AM
  2. [SOLVED] Prevent closing of a workbook if condition is met - code included
    By VBA FTW in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-14-2013, 10:24 AM
  3. Excel Web Browser Query (workbook included)
    By spursrule68 in forum Excel General
    Replies: 1
    Last Post: 07-03-2012, 05:58 PM
  4. [SOLVED] Cell Hyperlink Reference Query (workbook now included)
    By spursrule68 in forum Excel General
    Replies: 10
    Last Post: 06-02-2012, 01:57 PM
  5. Excel Marquee! Workbook included with half-working example
    By spursrule68 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-01-2012, 02:42 PM
  6. Run macro based on combo box seelction (workbook included)
    By 4am in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-26-2011, 09:45 PM
  7. Questions on copying range from closed workbook to active workbook
    By stevebriz in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-01-2007, 09:45 AM

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