Results 1 to 6 of 6
  1. #1
    mp3909 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    136

    Access Form Load

    When I open up my access file, the very first command button on my main form appears to be selected/activated/whatever you want to call it.
    So when I press the enter key on my keyboard, it triggers the VBA code built for that button.

    I have 9 command buttons on my main form.



    How do I prevent any of the buttons from being selected by default when you first open up the database?

  2. #2
    ranman256's Avatar
    ranman256 is offline VIP
    Windows Vista Access 2010 32bit
    Join Date
    Apr 2014
    Location
    Kentucky
    Posts
    9,524
    in form design, select a NON button control, properties window
    OTHER tab,
    set the TAB INDEX = 0,
    this will be the default item selected.

    if user presses tab key, it will cycle thru the controls starting at 0 , then 1, 2,etc. in that order.

  3. #3
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Something has to have focus. You could create a tiny textbox and have it get focus first.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  4. #4
    mp3909 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    136
    I don't see a TAB INDEX property?

  5. #5
    mp3909 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Feb 2018
    Posts
    136
    I see it for a command button though but I don't want any of my command buttons to be selected when the forms first loads

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Any control that can have focus should have that property. Some types of controls can't have focus so won't have that property.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

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

Similar Threads

  1. Replies: 9
    Last Post: 05-30-2017, 04:11 PM
  2. Replies: 5
    Last Post: 03-07-2017, 07:56 AM
  3. Replies: 8
    Last Post: 07-27-2012, 12:23 PM
  4. How to LOAD access form without ribbons and toolbar?
    By taimysho0 in forum Programming
    Replies: 5
    Last Post: 07-05-2012, 07:19 AM
  5. Replies: 3
    Last Post: 08-23-2011, 04:35 PM

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