Results 1 to 7 of 7
  1. #1
    bilalo is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    107

    Select record on subform


    I have a form and a subform. When I update a field in the subform, I need to refresh the parent form.The problem is that when the parent form is refreshed, the subform moves focus to the top row so I have to scroll down to go back to the row that I updated.I tried findfirst and bookmarks to select the updated row but with no luck.Any idea how to refresh the parent form while keeping the selected row in the subform focused?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    How are the form and subform linked?
    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
    orange's Avatar
    orange is offline Moderator
    Windows 10 Office 365
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,722
    You may get some insight from this thread.
    Requery Main Form after updating SubForm without losing position

  4. #4
    bilalo is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    107
    Quote Originally Posted by Welshgasman View Post
    How are the form and subform linked?
    Linked via ID

  5. #5
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    And how are you refreshing the form?
    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

  6. #6
    Micron is online now Virtually Inert Person
    Windows 10 Access 2016
    Join Date
    Jun 2014
    Location
    Ontario, Canada
    Posts
    12,793
    When I update a field in the subform, I need to refresh the parent form.
    That seems like an unusual requirement. Regardless, bookmarking the current record in the subform, refresh/requery main form, then go back to the bookmark is the usual approach AFAIK. If it didn't work for you, perhaps post what you tried.
    The more we hear silence, the more we begin to think about our value in this universe.
    Paraphrase of Professor Brian Cox.

  7. #7
    bilalo is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Jan 2019
    Posts
    107
    I bookmarked the current record then got back to it after refreshing but that wasn't enough.
    I don't know why, but it seems that setting the focus to another control and then setting the focus to the subform made it work perfectly
    Thank you guys.

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

Similar Threads

  1. Replies: 16
    Last Post: 07-16-2018, 09:50 AM
  2. Replies: 1
    Last Post: 02-23-2013, 01:04 AM
  3. select Subform record and go to record on form
    By pcool in forum Programming
    Replies: 6
    Last Post: 04-16-2012, 05:50 PM
  4. Replies: 5
    Last Post: 02-06-2012, 03:58 PM
  5. Replies: 1
    Last Post: 03-15-2011, 03:53 PM

Tags for this Thread

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