Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2002

    Question Unanswered: Putting scroll functionality in a command button

    Does anyone out there know how I could create two buttons that would allow me to scroll up and down a page of a form? What I mean is to make command buttons that function somewhat like the scroll bars on the side of the form. The users of my access 2002 database application view it using different screen resolutions(due to differing visual accuities) and because they open it using terminal services, sometimes the lower resolution people have a difficult time getting at the scroll bars. So, I would like to put a couple of buttons nearer to the center of the page that would cause the page to scroll down when pushed. Thank you all in advance for your time and your responses.

  2. #2
    Join Date
    Nov 2003
    One way you can do this is to set up dummy unbound TextBoxes in strategic locations on your form. How many you ude is up to you. Set these textboxes up so that they can not be seen (do not set the Visible property to False). Completely collapse them, set the borders to transparent, set the background color to match the form, etc.. You should be able to collapse it enough so that the TextBox carret can't be seen when focus is received.

    Now in the OnClick event for a command button in your form, you might do something like this:


    If your dummy text box is located off the form (to one side or the other, top or bottom) Access will automatically advance the form to that location so as to view the control which received focus.

    The second SetFocus is optional and it is to an actual working visble control on your form.

    I've used this method on a couple of occasions and it worked out quite well.
    The only other option would be to use a bunch of API functions.

    Self Taught In ALL Environments.....And It Shows!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts