Hello everyone, please i need your help, i have a code in the module and am trying to be able to set the vba code to able to stop at the end of record, i have tried the the Myset.EOF which is not working for me because it keeps runing with no ending, i don't maybe theres other ways to this kindly help
this is the code
Function SendMyEmail()
Dim MySet As ADODB.Recordset
Set MySet = New ADODB.Recordset
MySet.Open "qryStaffSalary", CurrentProject.Connection, adOpenStatic
Do Until MySet.EOF
DoCmd.SendObject acReport, "rptStaffSalary", "SnapshotFormat(*.snp)", , "", "", "Payslip", "Please find attached your payslip", True, ""
MySet.MoveNext
Loop
End Function
i don't know how to explain this but if you can relate kindly help
many thanks
this is the code
Function SendMyEmail()
Dim MySet As ADODB.Recordset
Set MySet = New ADODB.Recordset
MySet.Open "qryStaffSalary", CurrentProject.Connection, adOpenStatic
Do Until MySet.EOF
DoCmd.SendObject acReport, "rptStaffSalary", "SnapshotFormat(*.snp)", , "", "", "Payslip", "Please find attached your payslip", True, ""
MySet.MoveNext
Loop
End Function
i don't know how to explain this but if you can relate kindly help
many thanks