Hi All!
I'm trying to Stop the code below at 100 record increments for 1 minute. Can someone tell me what to put in where the ** are to stop the code for say one minute?? If I run this code, it bogs down the our e-mail system. Any advice would be MOST appriciated!!!!!!!!!!!
Regards!
Itch
Private Sub CmdSend_Click()
On Error GoTo Err_CmdSend_Click
Dim db As DAO.Database
Dim rs As DAO.Recordset
' Dim Mail As MailSender 'Set Ref to Persits AspEmail 4.5.0.2
' Dim strEmail As String
Dim txtCount As Long
' strEmail = " "
Set db = CurrentDb
Set rs = db.OpenRecordset("qryEMailList", dbOpenDynaset)
txtCount = 0
' Set Mail = New MailSender
rs.MoveFirst
Do Until rs.EOF
' Mail.Host = "Stuff"
' Mail.From = "Stuff"
' Mail.FromName = "Stuff"
'
' Mail.AddAddress "stuff" '
' Mail.AddCC "Stuff"
' Mail.AddCC "Stuff"
' Mail.Subject = "Stuff"
' Mail.Body = "Stuff"
' Mail.Send
DoCmd.GoToRecord acDataForm, "frmNotify", acNext
rs.MoveNext
txtCount = txtCount + 1
Me.txtCountShow = txtCount
If txtCountShow = 100 or 200 or 300 or 400 or 500 Then
**What goes here?????????????**
End If
Loop
MsgBox "All E-Mail Messages Have Been Sent.", vbInformation, "G.M.R.O.I. Application"
Me!cmdClose.SetFocus
Me!cmdSend.Enabled = False
Set rs = Nothing
Exit_CmdSend_Click:
Exit Sub
Err_CmdSend_Click:
MsgBox Err.Description
Resume Exit_CmdSend_Click
End Sub
I'm trying to Stop the code below at 100 record increments for 1 minute. Can someone tell me what to put in where the ** are to stop the code for say one minute?? If I run this code, it bogs down the our e-mail system. Any advice would be MOST appriciated!!!!!!!!!!!
Regards!
Itch
Private Sub CmdSend_Click()
On Error GoTo Err_CmdSend_Click
Dim db As DAO.Database
Dim rs As DAO.Recordset
' Dim Mail As MailSender 'Set Ref to Persits AspEmail 4.5.0.2
' Dim strEmail As String
Dim txtCount As Long
' strEmail = " "
Set db = CurrentDb
Set rs = db.OpenRecordset("qryEMailList", dbOpenDynaset)
txtCount = 0
' Set Mail = New MailSender
rs.MoveFirst
Do Until rs.EOF
' Mail.Host = "Stuff"
' Mail.From = "Stuff"
' Mail.FromName = "Stuff"
'
' Mail.AddAddress "stuff" '
' Mail.AddCC "Stuff"
' Mail.AddCC "Stuff"
' Mail.Subject = "Stuff"
' Mail.Body = "Stuff"
' Mail.Send
DoCmd.GoToRecord acDataForm, "frmNotify", acNext
rs.MoveNext
txtCount = txtCount + 1
Me.txtCountShow = txtCount
If txtCountShow = 100 or 200 or 300 or 400 or 500 Then
**What goes here?????????????**
End If
Loop
MsgBox "All E-Mail Messages Have Been Sent.", vbInformation, "G.M.R.O.I. Application"
Me!cmdClose.SetFocus
Me!cmdSend.Enabled = False
Set rs = Nothing
Exit_CmdSend_Click:
Exit Sub
Err_CmdSend_Click:
MsgBox Err.Description
Resume Exit_CmdSend_Click
End Sub