|
-
May 9th, 2001, 04:50 AM
#1
jumping to next record
Hi,
Maybe a beginners question, but ...
I have a button, that onclick goes to the next record of my form.
My question now is: how can I repeat this, as long as the user holds the button down?
Patzer
have a nice day,
Patzer
have a nice day
Patzer
_____________________________
Philo will never be forgotten
-
May 9th, 2001, 05:17 AM
#2
Re: jumping to next record
You can use the MouseDown and MouseUp events of the button. In the mousedown start looping until the mouseup occurs.
Dim ButtonPressed as Boolean
private Sub Command1_MouseDown(Button as Integer, Shift as Integer, X as Single, Y as Single)
ButtonPressed = true
Dim LastSec as integer
Do While ButtonPressed
' this is to foresee a delay
' we dont want the user seeing 500 recs in a second.
If LastSec <> DatePart("s",now) then
if not(rst.eof) then
rst.movenext
end if
LastSec = DatePart("s",now)
end if
' WARNING: YOU MUST USE DOEVENTS IN ORDER to TRAP THE MOUSEUP EVENT!
DoEvents
Loop
End Sub
private Sub Command1_MouseUp(Button as Integer, Shift as Integer, X as Single, Y as Single)
ButtonPressed = false
End Sub
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|