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

How to make command button page down

Status
Not open for further replies.

pleasehelpalot

Instructor
Oct 4, 2005
92
US
I have a command button on a form which has a 'down' arrow symbol on it. When the user clicks on the button I want it to page down. In other words to make the 'on click' event the same as hitting the page down key. What is the code to make this happen?
 
I checked the sendkey instructions and they don't seem to be what I need. Set focus does not page correctly and leaves the screen out of order. I need to find a way to make the command button work as clicking the 'page down' key. I remember doing something like this in the past but lost the code. Page down works as needed.
 
What happens with SendKeys "{PGDN}". What version of Access are you working in?
 
Sendkey should work fine. You probably need to set the focus to a text box if you want the records to scroll.
 
This is new territory for me. Do you need to set up a Macro to use sendkey?
 
Something like

Private Sub Command7_Click()
'set focus first to text box
Me.EmployeeID.SetFocus
SendKeys "{PGDN}"
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top