Make a drawing via access using loop

Z

zionsaal

I have a table with one field in it and i wont to draw one record so
i open a form and i created a loop to go to the next record randomly
the whole table and then every second minute I stop the loop and i
got the winner means the record where the loop stop in it

but I don't have a way to stop the loop only by pressing ctrl break
I wont to code that when i will press any key it should stop running
the code and it should came op a MSG box with the name
any help please?
thanks

here is the code
Private Sub Command2_Click()
gggg:
DoCmd.GoToRecord , , acFirst
Do Until Me.NewRecord
DoCmd.GoToRecord
{here I wont to put: if key = enter then exit sub and do this and
this}
Loop
GoTo gggg
End Sub
 
Z

zionsaal

I have a table with one field in it and i wont todraw one record so
i open a form and i created a loop to go to the next record randomly
the whole table and then every second minute I stop the loop and i
got the winner means the record where the loop stop in it

but I don't have a way to stop the loop only by pressing ctrl break
I wont to code that when i will press any key it should stop running
the code and it should came op a MSG box with the name
any help please?
thanks

here is the code
Private Sub Command2_Click()
gggg:
DoCmd.GoToRecord , , acFirst
Do Until Me.NewRecord
DoCmd.GoToRecord
{here I wont to put: if key = enter then exit sub and do this and
this}
Loop
GoTo gggg
End Sub

does any one have a way for me?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top