Results 1 to 6 of 6
  1. #1
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168

    Problem with Enter Key action .. in Unbound Form

    I have the most annoying problem. I have an unbound form .. and when I am entering data and press Enter, the form fires the Click event of a Command Button that runs a SQL Insert. (this button is not even a TAB stop at all).

    If I press Tab ... there is no problem. But I am used to pressing Enter .. and I want to go to the next Field in the form and not fire off the Command Button til all the data has been entered.



    I want to manually fire the Command button .. usually with a mouse click when all the data has been entered. (basically I would like the Enter key to act like the Tab key).

    Anyone have any ideas ?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    That should only happen if the button has focus.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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.

  3. #3
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Quote Originally Posted by June7 View Post
    That should only happen if the button has focus.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    I will see if I can replicate the problem in a test database.
    Last edited by edmscan; 05-23-2015 at 12:25 AM. Reason: Added Datebase File

  4. #4
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    Test.accdb

    If you go from First Name .. to Last Name via Tab it is fine. If you press Enter from First Name .. you fire the command button.

  5. #5
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    This is bizarre. I tried to replicate behavior in one of my dbs and can't. I built a new form in your db and do not get the issue. I deleted your button and created new button. Do not get the issue.
    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
    edmscan is offline Competent Performer
    Windows 8 Access 2010 32bit
    Join Date
    Feb 2014
    Posts
    168
    I found the problem .. Google is my friend. Re the below link .. the 2nd post was my answer. The default property of the 'Command Button' was set to YES .. and that is what is causing the problem. If it is set to NO .. the enter sends focus to the next field. I learned something .. which is never a bad thing. I tested it on the above database and it works fine now.

    http://bytes.com/topic/access/answer...enter-text-box

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

Similar Threads

  1. Replies: 4
    Last Post: 03-23-2015, 09:52 AM
  2. Replies: 3
    Last Post: 05-22-2013, 06:24 PM
  3. Form unbound field control problem?
    By justphilip2003 in forum Forms
    Replies: 22
    Last Post: 04-18-2013, 03:39 PM
  4. Unbound field control Problem
    By justphilip2003 in forum Programming
    Replies: 1
    Last Post: 03-20-2013, 09:10 AM
  5. Replies: 1
    Last Post: 03-10-2010, 04:53 AM

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