Results 1 to 3 of 3
  1. #1
    JB510's Avatar
    JB510 is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Jan 2023
    Location
    Ontario
    Posts
    42

    Txtbox_AfterUpdate() will not set focus back to the Txtbox on command - Help?

    I have created a AfterUpdate event on a textbox. It moves the data typed in the textbox into a list, then if there are more data to enter, it is to clear the textbox and then "Txtbox.Setfocus".



    The code works all except the setfocus. The code ignors the setfocus command and moves to the next tabbed item on the form.
    I tried setfocus on other fields and it works each time but it will not work for the testbox I'm moving from.

    Why? - How do I set the focus back to the same textbox in the afterevent?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,944
    Set focus to another control, then set back to your textbox control.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    JB510's Avatar
    JB510 is offline Advanced Beginner
    Windows 11 Office 365
    Join Date
    Jan 2023
    Location
    Ontario
    Posts
    42
    It worked! Thanks, that is weird.

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

Similar Threads

  1. Back Color of Text Box With Focus
    By lefty2cox in forum Forms
    Replies: 7
    Last Post: 03-05-2021, 09:36 PM
  2. Replies: 3
    Last Post: 06-29-2015, 09:50 AM
  3. Bring back focus to a form
    By AbbHeDa in forum Programming
    Replies: 6
    Last Post: 04-28-2012, 01:50 AM
  4. DoCmd.OpenReport focus reverts back to form
    By shabbaranks in forum Programming
    Replies: 2
    Last Post: 01-07-2012, 06:18 PM
  5. 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

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