Results 1 to 8 of 8
  1. #1
    chr1stoper1 is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    55

    enter button

    Hi Guys

    Im making a simpl database ad I have a form which populates a table with the information on the form when I click add new record button.


    If I use the enter button instead of the tab button to navigate around the form it adds whatever info is on the form at tht point.
    Is there a way that the enter button can be used to navigate the form and ony use the add button for data entry?

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Try changing the cycle property of the form.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    chr1stoper1 is offline Advanced Beginner
    Windows 8 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    55
    Thanks for the reply but that didnt worky

  4. #4
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,411
    You would have to use an unbound form. The add button event would run an INSERT query.

  5. #5
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    Can you attach the db here?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  6. #6
    Micron is offline Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,799
    you are making this more difficult than it needs to be by not adapting. Don't understand why so many people want a behaviour that's been around for eons to work some other way.
    A control that has an enter key property has 2 options - default (which I presume defaults to your db options setting for record navigation) and New Line. If you want it to do something else, you will have to trap for the Enter key press. Then it introduces the issue of whether or not you put it on every control that needs it, or set the form keypreview property to yes/true so that you can just do it for the whole form. What happens when you start combining Enter with other keys like Alt or Ctrl is a guess for me. If you trap the enter key press, don't be surprised if it slows the form down because the db will have to evaluate every key to see if it's the enter key.

    One could just learn that key navigation is Tab, and assimilate! Ok, no more soapbox
    Last edited by Micron; 07-19-2019 at 01:32 PM. Reason: corrected "error key press" to "Enter key press"
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,521
    I have apps used by "head down" data entry people that use both. They want the enter key to take them to the next control, the tab key jumps them to the next section (they enter a lot of numbers, so the 10-key enter button is probably fastest for them). I trap for the tab key in a function called from several controls. They haven't complained about form speed, and they're not shy about doing so. They just complained today about one extra keystroke because focus was going to the wrong place in a new feature.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  8. #8
    Dave14867's Avatar
    Dave14867 is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Nov 2016
    Location
    Upstate NY
    Posts
    376
    Micron,

    How do you really feel? Just kidding, loved the response.

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

Similar Threads

  1. Replies: 4
    Last Post: 03-27-2019, 09:42 PM
  2. use a button to enter a value into a table
    By campbell707 in forum Forms
    Replies: 18
    Last Post: 12-27-2015, 12:01 AM
  3. Replies: 11
    Last Post: 04-29-2015, 01:39 PM
  4. Replies: 3
    Last Post: 03-11-2015, 03:28 PM
  5. Seeking a User Friendly enter Button Logic
    By justphilip2003 in forum Programming
    Replies: 4
    Last Post: 05-10-2013, 12:12 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