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 derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Scroll method (Reseting the scrollbars)

Status
Not open for further replies.

sagamw

Technical User
Nov 11, 2009
104
GR
I have a form called "Eikones" and a subform called "Eikona" inside it.

I was able to hide/show the 2 (horizontal & vertical) scrollbars of the subform with the following command
Code:
[forms]![Eikones]![Eikona].form.scrollbars = 0
but I also want to be able to move the scrollbars far top/far left i.e. to reset their positions (with a button) if the user has moved them.

I found (in access 2007 help file) that such method exists, and I am trying something like
Code:
[forms]![Eikones]![Eikona].form.scroll(5,5)
but I get an error.

Is it applicable to forms or what is the correct syntax?
If not, How can I reset the position of the scrollbars of my subform?

 
How are ya sagamw . . .

To my knowledge there's no [blue]Scroll[/blue] property for a form. However, setting focus to the 1st record and the far left control should do the trick! ... You could also requery the form.

See Ya! . . . . . .

Be sure to see thread181-473997 [blue]Worthy Reading![/blue] [thumbsup2]
Also faq181-2886 [blue]Worthy Reading![/blue] [thumbsup2]
 
Hi TheAceMan1 and thank you for answer.

Unfortunately my subform it's not a continuous form so I can't focus to the 1st record (if I understood your suggestion).

I am trying (and so far with success) to build a simple image viewer inside my db. The "Eikona" subform it contains only an image object, the size of the subform.
It works well BUT, if it displays a big (bigger then the 'window' of the subform in my main form) image, and the user has moved the scrollbars, then the next (smaller) image it selects, is off the window! (looks cropped)
because the scrollbars are staying in their previous position.

(the whole concept is far more complicate but I don't want to tire you with all the details)

All I want is to reset the position of the scrollbars...
Any other ideas?

P.S. I was trying to do something with the sizetofit
method. Like to shrink the subform to the size of my image object (that I am already able to alter its size)
Do I have any chance with that?


 
Well I did it!!!
I put an object top left and I used .SetFocus
Elementary my dear Watson!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top