hi Eric,
Do you mean paste ***MY CODE HERE*** in these methods like the examples
below; I have pasted the code block in the other two methods, but it only
loops twice. It pastes the first record, then loops once to paste the second
record, and then stops.
Oh, how hard could it be? I've posted it all before:
Option Compare Database
Option Explicit
Private db As DAO.Database
Private rs As DAO.Recordset
Private LoopContinue As Boolean
Private Sub cmdPause_Click()
LoopContinue = False
End Sub
Private Sub cmdResume_Click()
LoopContinue = True
DoLoop
End Sub
Private Sub cmdStart_Click()
Set db = CurrentDb
Set rs = db.OpenRecordset( _
"SELECT [Run_waypoint] " & _
"FROM tbl_Run_Reveal_Selector " & _
"WHERE [Run_No] = " & Forms!frm_Runs!Run_No & " " & _
"ORDER BY [Run_waypoint];", _
dbOpenForwardOnly)
LoopContinue = True
DoLoop
End Sub
Private Sub DoLoop()
Do While Not rs.EOF And LoopContinue
'setfocus
Forms![frm_Runs].[frm_Run_Reveal_Target].SetFocus
Forms![frm_Runs].[frm_Run_Reveal_Target].Form.[Run_waypoint].SetFocus
'pastes record from table into target form
Forms.frm_Runs.[frm_Run_Reveal_Target].Form.[Run_Direction] = _
Me.Run_Direction
Call sSleep(500)
Forms.frm_Runs.[frm_Run_Reveal_Target].Form.[Run_waypoint] = _
Me.Run_waypoint
Forms.frm_Runs.[frm_Run_Reveal_Target].Form.[Postcode] = Me.Postcode
Forms.frm_Runs.[frm_Run_Reveal_Target].Form.[OrderSeq] = Me.OrderSeq
DoCmd.GoToRecord , , acNewRec
Forms![frm_Runs].[frm_Run_Reveal_Selector].SetFocus
Forms![frm_Runs].[frm_Run_Reveal_Selector].Form.[Run_waypoint].SetFocus
DoCmd.GoToRecord , , acNext
Call sSleep(Me.cbo_Run_Reveal_Timer)
DoEvents
Loop
End Sub
mfG
--> stefan <--