3 Replies Latest reply on Dec 13, 2014 10:45 AM by TomPingel

    positioning a calculated 'go to' record in the center of the window

    TomPingel

      Title

      positioning a calculated 'go to' record in the center of the window

      Post

      I wasn't sure how to title this. Here's what I'd like to do:

      i'm using a script with a calculated 'go to record' value and would like the 'gone to' record in list view to appear vertically  in the center of the window.

      If there were a 'get cursor position' function I could figure out what to do, but I don't think such a function exists, and I would hope there were a more elegant approach.

      Any suggestions?

        • 1. Re: positioning a calculated 'go to' record in the center of the window
          SteveMartino

          Are you saying you want the related record to appear in a list, say of 50, but you want it to appear in the middle of that list view layouts window, or are you saying when the related record pops up in the window you want that window to positioned in the center of your screen?

          • 2. Re: positioning a calculated 'go to' record in the center of the window
            philmodjunk

            It isn't always possible to scroll a window to position the current record in the middle of your screen as there might be cases when there are not enough records in your found set or the record may be too close to the end or beginning of that set.

            But in cases where those situations do not occur, if your layout can display N records, you can use go to record to scroll the window N + 1 records down to scroll the record off the top of the window and then scroll the window to a record N/2 records above the specified record before doing a third go to record to position the record in the center of the window and make it the current record.

            The value of N, however, may change with a given computer's screen size and pixel resolution.

            • 3. Re: positioning a calculated 'go to' record in the center of the window
              TomPingel

              I think I've got it.

              I created a 'blank form' layout for the table. I go to the blank layout to do the calculated 'go to record', then go to the list view.

              The selected record is at the bottom of the list view.

              I go to current record plus 1/2 the number of records shown in the list view, then go back to the 'selected' record. It's in the middle of the screen. A little screen flashing, but not too annoying.

              Boundary conditions work well for first few and last few records as well without having to do anything special for them.

              Thanks for the help!