Results 1 to 6 of 6
  1. #1
    rs2k is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    3

    Send to last textbox that had focus

    Hi,

    I have built a form for time sheet entry and part of this form has a custom time-picker, the user clicks a button for the hour and then a button for the minute, this is then combined into a textbox. There are 2 buttons 'confirm' and 'cancel' when confirm is clicked I need to send the time to the last selected textbox (time entry) that had focus, the time entry textboxes are on a continuous subform. But as soon as a time is picked the focus has changed.

    Is there a way around this?

    Many thanks


    Colin

    This has also been posted on another forum.

  2. #2
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    Nothing is impossible but, without storing data in an additional table(s) to track the movement of the cursor, the answer is no.

  3. #3
    rs2k is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    3
    Ok, thank you. I wont waste any more time with this then.

    Cheers
    Colin

  4. #4
    ItsMe's Avatar
    ItsMe is offline Sometimes Helpful
    Windows 7 64bit Access 2010 32bit
    Join Date
    Aug 2013
    Posts
    7,862
    On second thought, I suppose a single variable declared in the VBA header could store the control name.

    Use code in each possible control's On Enter event handler.

    strLastFocus = "Hard Coded Text Here that is the name of the control"

  5. #5
    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
    I'm not really clear as to what you're describing, but there is a command

    Screen.PreviousControl

    that may do what you need.

    Linq ;0)>

  6. #6
    rs2k is offline Novice
    Windows 7 64bit Access 2007
    Join Date
    Oct 2012
    Posts
    3
    Hi, sorry been away for a week. I will try out your suggestions and post back.

    Cheers
    Colin

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

Similar Threads

  1. Replies: 3
    Last Post: 07-09-2014, 02:49 PM
  2. Replies: 1
    Last Post: 06-18-2014, 09:39 PM
  3. Replies: 5
    Last Post: 10-29-2012, 05:53 AM
  4. SET focus back to TEXTBOX if validation does NOT pass
    By taimysho0 in forum Programming
    Replies: 5
    Last Post: 12-04-2011, 10:10 PM
  5. Replies: 1
    Last Post: 05-29-2010, 02:39 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