Results 1 to 3 of 3
  1. #1
    JRodko is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    127

    Maintain same position when switching between forms.

    Hello,

    I am trying to solve an issue that I feel should be fairly simple. Much of my data entry is done on datasheet subforms that are accessed via tabs on a main form. IE main form is Province, and tabbed subforms are CITY1, CITY2, CITY3, with similar but not always relate-able data.



    Is there anyway to have all my forms open to the last position they were at when previously viewed?

    I currently have all the forms go to new record when they are opened. If I can't save the screen position and return there, then perhaps I could just return to the last selected record? This would save a ton of time as I frequently need to switch between other forms for referencing data that is not always related. The datasheet forms also get too long to fit on one page, so constantly going to the bottom (new record) and then scrolling gets tiresome quickly.

    Thank you!

  2. #2
    CJ_London is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,430
    it can be done - you need to determine the scrollbar position, save it somewhere then reapply it when the form is revisited.

    to get and set the scrollbar position, see this link http://www.lebans.com/SelectRow.htm. It is a mdb

    however not sure why if you are just leaving a form, it would reset its scroll position to top or bottom - this implies you are refreshing/requerying/closing-opening the form - in which case using the scrollbar position may not work if the recordset has changed in any way.

    An alternative is to save the pk or other unique id for the row and when opening use the find method to find the record

    don't know if you have considered using overlapping windows rather than tabbed forms (file>options>current database) then you can view forms side by side.

  3. #3
    JRodko is offline Competent Performer
    Windows 10 Access 2016
    Join Date
    Oct 2018
    Posts
    127
    Thank you for this, Ajax.

    Your comments on closing-reopening made me realize that my controls to switch between main forms were in fact closing and reopening forms. I have disabled that macro, and now everything works as it should.

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

Similar Threads

  1. Forms position next to another
    By LonghronJ in forum Modules
    Replies: 2
    Last Post: 08-21-2018, 04:07 PM
  2. Error while switching forms
    By Bradex in forum Forms
    Replies: 15
    Last Post: 03-17-2016, 08:14 PM
  3. Replies: 5
    Last Post: 06-05-2013, 05:59 PM
  4. Replies: 5
    Last Post: 09-05-2012, 06:42 PM
  5. Replies: 1
    Last Post: 09-15-2010, 07:34 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