Here is the complete code (below)...
It takes all but one record on the first click, and the last one on the second. When there is only one item, it works great.
The endloop is there in case of an error, and I would imagine this is the problem. However, there should not be an error! Four counts, four records... When I remove it, I do get an error of:

Perhaps running the 'GenerateEmailContent_Weekly (txtEmpID)' is knocking somwething out of whack??
Thanks again!
Code:
Private Sub cmdSubmitTimeCard_Click()
Dim rs As adodb.recordset
Set rs = New adodb.recordset
Dim sql As String
sql = "SELECT * FROM tblocalApprovalLog "
sql = sql & "WHERE (empid = '" & Forms!frmTimeCard.txtEmpID.Value & "' OR supid = '" & Forms!frmTimeCard.txtEmpID.Value & "') "
sql = sql & "AND approve = True "
sql = sql & "AND approved = False "
sql = sql & "AND dayDate = '" & Forms!frmTimeCard.txtDate.Value & "' "
sql = sql & "AND weekDate = '" & Forms!frmTimeCard.txtPeriodStart.Value & " - " & Forms!frmTimeCard.txtPeriodEnd.Value & "' "
sql = sql & "AND shortchar02 = 'Salaried'"
Debug.Print ("sql: " & sql)
rs.Open sql, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
On Error GoTo endloop
Dim c As Integer
c = 0
Do While Not rs.BOF Or rs.EOF
c = c + 1
Debug.Print ("RecordCount: " & CStr(c))
' On Error GoTo endloop
txtEmpID = rs.Fields("empid")
rs.Fields("approved") = True
' Send EMail
GenerateEmailContent_Weekly (txtEmpID)
Debug.Print ("Email # " & c & " has been sent.")
rs.MoveNext
Loop
endloop:
Me.Requery
rs.Close
Set rs = Nothing
End Sub
Code:
Private Sub GenerateEmailContent_Weekly(txtEmpID As String)
Debug.Print ("Running Weekly...")
PopulateDates
' Create the queries
sqlReportMain = "SELECT TimeCards.*, dbo_empbasic.name, dbo_empbasic.shortchar02, #" & datPeriodStart & "# As periodstart, #" & datPeriodEnd & "# As periodend, " & _
"iif(TimeCards.BillType='P' or TimeCards.BillType='S',TimeCards.laborhours,0) As Burden, " & _
"iif(TimeCards.BillType='P' or TimeCards.BillType='S',TimeCards.OpCode,'9999') As ResourceGroup " & _
"FROM TimeCards " & _
"LEFT JOIN dbo_empbasic ON TimeCards.empid = dbo_empbasic.empid " & _
"WHERE (TimeCards.empid = '" & txtEmpID & "') " & _
"AND (TimeCards.Date Between #" & datPeriodStart & "# And #" & datPeriodEnd & "#) " & _
"AND Len(nz(TimeCards.billtype,'')) > 0 " & _
"AND dbo_empbasic.shortchar02 = 'Salaried' "
Debug.Print ("sqlReportMain: " & sqlReportMain)
sqlReportSub = "SELECT qryTime.billtype, qryTime.indirectcode, qryTime.jobnum, qryTime.oprseq, qryTime.opcode, " & _
"Sum(qryTime.laborhours) AS SumOflaborhours, Sum(qryTime.qtycompleted) AS SumOfqtycompleted, " & _
"Sum(qryTime.qtyscrap) AS SumOfqtyscrap, Sum(qryTime.Burden) AS SumOfBurden, qryTime.ResourceGroup " & _
"FROM (" & _
sqlReportMain & _
") As qryTime " & _
"GROUP BY qryTime.billtype, qryTime.indirectcode, qryTime.jobnum, qryTime.oprseq, qryTime.opcode, qryTime.ResourceGroup "
Debug.Print ("sqlReportSub: " & sqlReportSub)
' DoCmd.OpenReport "rptweekly", acViewPreview
' DoCmd.SendObject acSendReport, "rptweekly", acFormatPDF, "TimeCards@metromachine.com", , , "Time Card"
Dim FileSavePath As String
FileSavePath = "c:\temp\" & txtEmpID & ".pdf"
DoCmd.OutputTo acOutputReport, "rptWeekly", acFormatPDF, FileSavePath, , , , acExportQualityPrint
Debug.Print ("FileSavePath: " & FileSavePath)
SendMessage (FileSavePath)
End Sub
Code:
Private Sub SendMessage(FileSavePath As String)
Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Dim txtEmpName As String
' txtEmpName = Nz(DLookup("name", "dbo_empbasic", "empid = '" & txtEmpID & "' "), "")
' txtEmpName = GetUserName(empid)
Dim sql As String
sql = "SELECT dbo_empbasic.* FROM dbo_empbasic WHERE dbo_empbasic.empid = '" & txtEmpID & "' "
Dim rs As adodb.recordset
Set rs = New adodb.recordset
rs.Open sql, CurrentProject.Connection, adOpenDynamic, adLockOptimistic
rs.MoveFirst
txtEmpName = rs.Fields("name")
Dim salaried As String
salaried = rs.Fields("shortchar02")
Debug.Print ("salaried: " & salaried)
rs.Close
Set rs = Nothing
Debug.Print ("txtEmpID: " & txtEmpID)
Debug.Print ("txtempname: " & txtEmpName)
Dim SD As String
Dim ED As String
If salaried = "Salaried" Then
SD = datPeriodStart
ED = datPeriodEnd
Else
SD = Forms!frmTimeCard.txtDate.Value
ED = Forms!frmTimeCard.txtDate.Value
End If
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
With MailOutLook
.BodyFormat = olFormatRichText
.To = "sanderson@metromachine.com"
''.cc = ""
''.bcc = ""
.Subject = "Timecard for " & txtEmpName & ""
.HTMLBody = "Attached is the timecard for " & txtEmpName & ", employee number " & txtEmpID & " for the period of " & CStr(SD) & " through " & CStr(ED) & "."
.Attachments.Add (FileSavePath)
.Send
'.Display 'Used during testing without sending (Comment out .Send if using this line)
End With
End Sub