Results 1 to 4 of 4
  1. #1
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2002
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383

    Going to next record using vba affects tab order


    I have command buttons my form that work fine and tab to the next command button. I tried using vba code on key down and exit for the command buttons but it made my tab order mess up.

    Here is my vba code; DoCmd.GoToRecord , , acNext

    Is there a better or different way to approach this without affecting my tab order ?

  2. #2
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    Why are you using command buttons to tab to the next button? Won't the TAB key serve the same purpose?

    What do you mean by the tab order gets messed up? It shouldn't, since it's a part of the form. You might end up with the focus (cursor) on the wrong control, but that's a different issue. Is there a reason why you are using the Key Down event? Command buttons normally use the On Click event to perform an action.

    Can you provide more information on what you are trying to do?

    John

  3. #3
    burrina's Avatar
    burrina is offline VIP
    Windows 7 64bit Access 2002
    Join Date
    Oct 2012
    Location
    Freeport,Texas
    Posts
    1,383
    I have buttons on my form. I am NOT using them as tab keys, they have their own code that runs. I just need to tab to the next button after firing the code on the button. I typically use the tab key to navigate my db by default. The command buttons do use the on click event. Do I then need to enter this code to fire right after the on click event as well?

    This an example of all he command button does.;

    CallNexttDte = two.Value ' which sets the date for another field.

  4. #4
    John_G is offline VIP
    Windows XP Access 2003
    Join Date
    Oct 2011
    Location
    Ottawa, ON (area)
    Posts
    2,615
    Hi -

    All you need to do is add DoCmd.GoToControl "ButtonName" as the last line in the On_Click event, to take you to the next command button (or any other control). No need to worry about the tab order.

    John

Please reply to this thread with any new information or opinions.

Similar Threads

  1. How to order columns in ascending order?
    By darkingthereturn in forum Access
    Replies: 5
    Last Post: 06-18-2012, 05:24 AM
  2. record order in table ( I think)
    By survivo01 in forum Access
    Replies: 7
    Last Post: 04-25-2012, 11:24 AM
  3. Order Tracking
    By aladrach in forum Access
    Replies: 9
    Last Post: 07-01-2011, 02:04 PM
  4. Id Order
    By Rockin-John in forum Forms
    Replies: 15
    Last Post: 05-03-2011, 02:39 PM
  5. Order by
    By cowboy in forum Access
    Replies: 2
    Last Post: 05-03-2010, 05:04 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums