Results 1 to 4 of 4
  1. #1
    Kody_Devl is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2017
    Posts
    22

    ListBox lost focus on CLICK event - Jumps off the selected record

    Hi All,



    I have a list box on a form with 10 items showing.

    If I click on item #6 of 10, the focus will jump from #6 to the first record.

    What vba code can I add so the focus will remain on Item #6 after I click it?

    Many Thanks

    Kody_Devl

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    Sounds like the listbox onclick event is requerying the listbox.
    Not much for us to go on. What is the purpose of the listbox and what do you want to happen when item 6 is clicked?
    What code is in the on_click event?

  3. #3
    Kody_Devl is offline Novice
    Windows 10 Access 2016
    Join Date
    Jun 2017
    Posts
    22

    Smile

    davegri

    Your question inspired me consider the Click event.
    Buried in the event is a sub-routine call "Requery_Form".
    I commented out Me.lstbox.requery and solved the problem.

    I humbly thank you .


    Kody_Devl

  4. #4
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,407
    Glad it worked out for you. Good luck with the project.

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

Similar Threads

  1. Replies: 18
    Last Post: 07-15-2020, 02:07 PM
  2. Replies: 2
    Last Post: 10-09-2016, 05:41 PM
  3. Replies: 9
    Last Post: 11-19-2015, 03:05 PM
  4. Replies: 13
    Last Post: 09-10-2015, 03:37 PM
  5. Replies: 3
    Last Post: 01-18-2014, 02:20 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