Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scrollbar position or record number

Status
Not open for further replies.

IdRatherBOutdoors

Programmer
Dec 20, 2002
5
US
I have a main form used to show work order number, customer name etc. This main form has 20 image controls on it, these are used to display tool size symbols. There is also a subform (Dataheet view) with all of the tools, tolerances, and hit counts used in the job shown in the main form. There can be up to 20 image controls displayed, which line up with each of the tools called out on the subform. 20 is the maximum number of tools shown on the subform before it will show a scrollbar.
When I move the scrollbar, it shows "Record X of Y" until I let up on the mouse button, similar to the record navigation buttons at the bottom of the form. I need to be able to determine where the scrollbar is at (The value of X), so I can adjust which image is displayed in the correct control on the main form to keep it alighned with the correct tool in the subform.
If This can not be determined, is there a way to show the bitmap images in datasheet view in the subform?
 
Have you tried using a macro or vb code in the "on_current" event of the form? I believe this event activates whenever you move to a new record in the form.
 
Yes to the VB code, but the user also has to select the topmost record after moving the scrollbar. I would prefer to have it update as soon as the scrollbar is moved, since there is a possibility of the operators accidently selecting the second or third from the top records (The size of the text controls are about .1667 to .175, I'm not sure exactly, I'm at home now and the form is at work).
I know there is a way to get the scrollbar position in Visual Basic by using window.document.body.scrollTop, but I have not been able to find anything similar in Access.
 
Another item I probably should have mentioned is that the bitmap names are stored in the database, not the images. I am updating the images on the "On Current" event to look in the drive/folder that the bitmaps are stored in. It works OK, up until I get more than the 20 images. Then the alignment needs to be offset by whatever the scrollbar position is at.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top