Try DoEvents
Option Compare Database
Option Explicit
Dim bolrun As Boolean
Private Sub Command2_Click()
DoCmd.GoToRecord , , acFirst
bolrun = False
Do Until bolrun = True
DoCmd.GoToRecord
DoEvents
Loop
End Sub
Private Sub Command2_KeyDown(KeyCode As Integer, Shift As Integer)
bolrun = True
End Sub
> I have a table with one field in it and I wont to draw one record so
> I created a form and I created a loop to go to the next record
[quoted text clipped - 19 lines]
> GoTo gggg
> End Sub
zionsaal@gmail.com - 08 Mar 2007 21:54 GMT
> Try DoEvents
>
[quoted text clipped - 41 lines]
>
> - Show quoted text -
thanks
here is the code
Option Compare Database
Dim bol As Boolean
Private Sub Command2_Click()
bol = False
gggg:
DoCmd.GoToRecord , , acFirst
Do Until Me.NewRecord
DoCmd.GoToRecord
DoEvents
Loop
If bol = True Then Exit Sub
GoTo gggg
End Sub
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
bol = True
MsgBox Me.MasterID
End Sub