More RecordSet Issues

Novice1

Registered User.
Local time
Yesterday, 18:56
Joined
Mar 9, 2004
Messages
385
(1) If I cancel the process (recordset cycle) after the first one or two reports are sent (no problem); however, if I cancel later in the process, the database locks up. (2) I cannot update a field [Remarks] while cycling through the records.

On Error GoTo Err_Image635_Click

Dim db As DAO.Database
Dim rs As Object

Set rs = CurrentDb.OpenRecordset("SELECT * FROM qry91To120DaysFromPDDEmail")

If Not rs.EOF Then
rs.MoveFirst
Do

DoCmd.OpenReport "rptPrintOneRecord120DayAlert", acViewPreview, , "ReloID = " & rs!ReloID, acHidden

DoCmd.SendObject acSendReport, "rptPrintOneRecord120DayAlert", acFormatPDF, blah, blah, True

DoCmd.Close acReport, "rptPrintOneRecord120DayAlert", acSaveNo

Me.Remarks = "Test"

'Me.Remarks = Me.Remarks & vbCrLf & Format(Now, "dd mmm yy") & ": " & Nz([Grade]) & " " & Nz([Last Name]) & " was reminded this date to provide us the necessary documents so we could generate PCS orders"


rs.MoveNext

Loop While Not rs.EOF

End If

Exit_SendReports_Click:
Exit Sub



Exit_Image635_Click:
Set rs = Nothing
Set db = Nothing
Exit Sub

Err_Image635_Click:
MsgBox Err.Description
Resume Exit_Image635_Click
 
Solution to first question: Change Popup from Yes to No (fixed the problem)
Still having a problem with the second question
 
Novice1,

Rs.edit
Rs!remarks = "..."
Rs.update

Wayne
 

Users who are viewing this thread

Back
Top Bottom