Results 1 to 8 of 8
  1. #1
    akotronis is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    4

    Problem with tab key on last control on a form page

    Hello everybody.

    I have made a form for data entry which has some pages. A next page button is the last control on each page and a go to next page command is triggered on click event (which has been entered using vba) and it works fine. Now the bad thing is:



    If the user hits tab or enter when the next page button is on focus, he/she goes to the next record which is something I don't want, as he/she may not realize it and continue entering values as if he/she was in the previous record.

    I tried entering on key press event for the next page buttons
    Code:
    If KeyCode = 9 Then PageWhatever.SetFocus End If
    but it just ignores it... Any ideas on why this may happen?

    Thanks in advance

  2. #2
    rpeare is offline VIP
    Windows XP Access 2003
    Join Date
    Jul 2011
    Posts
    5,442
    set the TAB STOP property of your NEXT button to NO

    Then they will never be able to activate it without physically clicking on the button.

  3. #3
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    In addition to rpeare's suggestion, I give users option of activating buttons with click or key strokes by using the shortcut key indicator. Type an & in front of letter in button Caption and the button can be triggered by pressing Alt+letter. If it is a form without any data controls, such as a 'main menu', the Alt isn't even needed, just press the associated letter.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  4. #4
    akotronis is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    4
    Hello again. Thanks for the reply. However I don't know how to do that, (I am a beginner). All the code that have put into the form was on a certain event via the property sheet of the corresponding control. Does this one have to be entered in the same way? If yes, on which event? Regarding the syntax, I have found this:
    Code:
    Forms("My form").Controls("My control").TabStop = False
    and tried to enter it as follows:

    Create->Module and entered it replacing the parameters for the form and control and saved it. But obviously this is not the way it way supposed to be entered as it doesn't work..

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    TabStop is a property that can be set on the Properties Sheet on the Other tab. Form in Design View, select the button, set the property.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  6. #6
    akotronis is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    4
    Oh, I found it. However, the problem remains. If I press tab being on the control just before the button, it goes to the next record (the thing I want to avoid), just not passing the focus on the button (it goes to the control just after it). The worst is that now, using the same steps described but with the Enter button, it also goes to the next record (something which didn't happen with the tab stop property set to yes)

  7. #7
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,632
    Actually, probably need to set the form Cycle property to CurrentRecord, also on the Other tab. Make sure the form is selected. Click on the little box at upper left corner.
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

  8. #8
    akotronis is offline Novice
    Windows 7 64bit Access 2010 64bit
    Join Date
    May 2013
    Posts
    4
    With the CurrentRecord sellection it behaves just as I want, even with Tab Stop = yes. Thank you both guys!

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

Similar Threads

  1. Problem with Form starting at the wrong position of a page
    By thebionicredneck2003 in forum Forms
    Replies: 2
    Last Post: 05-10-2013, 12:49 PM
  2. Form unbound field control problem?
    By justphilip2003 in forum Forms
    Replies: 22
    Last Post: 04-18-2013, 03:39 PM
  3. Problem with page formatting on form
    By robertmarkdudley95 in forum Forms
    Replies: 1
    Last Post: 03-30-2012, 03:05 AM
  4. Control Page Headers with VBA?
    By FL_Boy in forum Reports
    Replies: 3
    Last Post: 12-22-2011, 03:49 PM
  5. Weird Form Control Problem
    By MWB in forum Access
    Replies: 3
    Last Post: 11-17-2010, 05:42 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