Question regarding a Next Record navigation button on a form
Question regarding a Next Record navigation button on a form
(OP)
Have a form which displays one record at a time on a form. I have control buttons on the form which allow the user to go to navigate to the next and previous records as well as a search button but the user would like to be able to "scroll" through the records as well.
It occurred to me that I might be able to accomplish this by putting dowhile loop code in the On Mouse Down event for the "next" and "previous" record control buttons that would loop through the gotorecord command until the user released the mouse button.
I have tried several things attempting to ascertain the status of the mouse button and everything fails (I don't seem to be able to tell whether the mouse button on the control is depressed or not. (i even turned on the auto repeat property to "yes" and this did not work either)
I figured if I put a loop in the OnMouseDown event and then could determine when the OnMouseUp event was triggered I could accomplish this :
Do While Me.NextRecord.OnMouseUp = False
DoCmd.GoToRecord , , acNext
Do Events
Loop
Does anyone have any suggestions as to how I might get something like this to work?
Thanks
Paul
It occurred to me that I might be able to accomplish this by putting dowhile loop code in the On Mouse Down event for the "next" and "previous" record control buttons that would loop through the gotorecord command until the user released the mouse button.
I have tried several things attempting to ascertain the status of the mouse button and everything fails (I don't seem to be able to tell whether the mouse button on the control is depressed or not. (i even turned on the auto repeat property to "yes" and this did not work either)
I figured if I put a loop in the OnMouseDown event and then could determine when the OnMouseUp event was triggered I could accomplish this :
Do While Me.NextRecord.OnMouseUp = False
DoCmd.GoToRecord , , acNext
Do Events
Loop
Does anyone have any suggestions as to how I might get something like this to work?
Thanks
Paul
RE: Question regarding a Next Record navigation button on a form
Kathryn
RE: Question regarding a Next Record navigation button on a form
How do i get this slider to work ? (geeze, isn't there a way to check the state of the mouse buttons in vba code in a function?........... seems a loop that would just keep getting the next or previous record as long as the button on the form was depressed would work beautifully for what i am trying to accomplish)
Paul
RE: Question regarding a Next Record navigation button on a form
techsupportgirl@home.com
Brainbench MVP for Microsoft Word
http://www.brainbench.com
RE: Question regarding a Next Record navigation button on a form
Here is an article on using the slider control in VB. It should be very similar in VBA.
http://msdn.microsoft.com/library/devprods/vs6/vbasic/vbcon98/vbconusingslidercontrol.htm
Kathryn