Results 1 to 3 of 3
  1. #1
    roaftech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2012
    Location
    Romania
    Posts
    65

    Cursor to follow SetFocus

    I have looked through the threads but can't find a solution ...

    My data entry form has a number of buttons, performing various functions via VBA code. These buttons have a tab sequence and, in addition, at the end of each function the focus is transferred to the next button, so that a series of presses of the Enter key would move through the form accepting the default action of each one.

    The problem is that the cursor stays wherever it happens to be after pressing the first button or by having moved the mouse. An inattentive (but habitual) click of the mouse can trigger the wrong action. How can I persuade the cursor to follow the setfocus sequence?



    TIA.

  2. #2
    Missinglinq's Avatar
    Missinglinq is offline VIP
    Windows 7 64bit Access 2007
    Join Date
    May 2012
    Location
    Richmond (Virginia, not North Yorkshire!)
    Posts
    3,018
    This kind of thing is going to require using an API or rolling your own Class, I think, neither of which I'd tackle for something this basic, but here's a tutorial about using an API for Excel, which should work for Access, as well:

    http://support.microsoft.com/kb/152969

    What I would do, to let the user know where the Focus is, would be to simply change the Command Button's Text color and weight when the button has Focus:
    Code:
    Private Sub Button1_GotFocus()
     Button1.ForeColor = vbRed
     Button1.FontBold = True
    End Sub
    Code:
    Private Sub Button1_LostFocus()
     Button1.ForeColor = vbBlack
     Button1.FontBold = False
    End Sub


    Linq ;0)>

  3. #3
    roaftech is offline Advanced Beginner
    Windows XP Access 2003
    Join Date
    Nov 2012
    Location
    Romania
    Posts
    65
    Thanks for the response. I already change the colours for the buttons to show progress through the form. The problem is that the cursor does not move to the new button and an accidental press of the mouse button actives an event out of sequence (eg, it reopens a subform and discards info already seleted.)

    I will have a look at the link - many thanks.

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

Similar Threads

  1. Add button to follow hyperlink in table
    By stanley721 in forum Forms
    Replies: 6
    Last Post: 06-22-2013, 08:49 AM
  2. Follow-up Reminder
    By 1gambit in forum Access
    Replies: 6
    Last Post: 06-30-2012, 11:42 AM
  3. Follow Up
    By robertjleach in forum Queries
    Replies: 2
    Last Post: 10-30-2011, 06:07 AM
  4. Follow up calls, put in automatic date
    By Loish in forum Access
    Replies: 1
    Last Post: 04-08-2010, 03:59 PM
  5. FOLLOW UP DATABSE
    By gab_esp in forum Database Design
    Replies: 2
    Last Post: 07-19-2006, 11:27 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