• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

Physical Row Position (position from top of visible rows)

I'm looking for a way to determine the physical position of the current record in a continuous form, in terms how how many rows it is from the top of the visible row set.

Purpose:  I'm going to build a little associated form that will sit to the right of the main (continuous) form. When I click on a row on the main form, causing it to become current, I'm going to vertically reposition the little associated form to be horizontally level with the current main form row.  I can use docmd.movesize for the repositioning operation itself, and I can pre-measure the row heights.  All I need is the count of rows from the top of the visible rows that indicates the position of the current row.

Any help with this would be appreciated.

Thanks!
0
codequest
Asked:
codequest
  • 3
  • 3
1 Solution
 
IrogSintaCommented:
A problem I can see if you are just counting from the top of a continuous form is what happens if you scrolled down and the top visible record is really record number 5.
0
 
IrogSintaCommented:
However is scrolling is not going to be an issue, you can use Me.CurrentRecord to give you the record number.
0
 
codequestAuthor Commented:
Thanks for the input.  Me.CurrentRecord gives a relative position from the start of the table, but does not give the relative position of the row within the view-able form records.  Might there be something in the RecordSetClone object that would speak to just what is viewable on the form?
0
Veeam and MySQL: How to Perform Backup & Recovery

MySQL and the MariaDB variant are among the most used databases in Linux environments, and many critical applications support their data on them. Watch this recorded webinar to find out how Veeam Backup & Replication allows you to get consistent backups of MySQL databases.

 
IrogSintaCommented:
As I mentioned, Me.CurrentrRecord would work if scrolling was not an issue -- in other words, all your records were already visible.  Since apparently, this is not the case, the only way I've been able to do this in the past was to get the mouse position when I click on a row and use that to determine where I would put another form using DoCmd.MoveSize
0
 
codequestAuthor Commented:
Thanks for input.  I did not understand your comment on scrolling.   I'll try working with mouse position.  It may take a week or so.
0
 
codequestAuthor Commented:
I checked out the mouse detection.  There are plenty of examples so I'm confident that it can be made to work.  Since no one else has contributed and this has been out there a while I'm going to accept this as the solution to my question.

FYI, I decided this was too sophisticated for the GUI for the app I'm building, so I'm going to use combo boxes as a substitute for sub-forms on my parent continous form.  Turns out the user only needs to see one record at a time (the "latest"), if they have quick access to the others.

Thanks!
0

Featured Post

Fill in the form and get your FREE NFR key NOW!

Veeam is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

  • 3
  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now