Lanason
Registered User.
- Local time
- Today, 01:58
- Joined
- Sep 12, 2003
- Messages
- 258
I have a routine that opens a form and creates emails and reports based up fields in the form (day of week etc). There are 31 possible reports.
The routine has a sub loop in case a certain reports needs to be personalised from each recipient. I have a "call" that writes an audit trail during the process.
HOWEVER, the main loop does not stop and find the end of the file and ends up with an error "No current record". I tried checking for it but that doesn't work. (ps the form is not filtered)
Can anyone help, as its doing my head in :banghead:
The routine has a sub loop in case a certain reports needs to be personalised from each recipient. I have a "call" that writes an audit trail during the process.
HOWEVER, the main loop does not stop and find the end of the file and ends up with an error "No current record". I tried checking for it but that doesn't work. (ps the form is not filtered)
Can anyone help, as its doing my head in :banghead:
Code:
Set myrec1 = Forms!frmReportsInternalSummary.Recordset
With myrec1
myrec1.MoveFirst
Do Until myrec1.EOF
ACTION etc
Set myrec2 = Forms.Item(RecordBasedEmailForm).Recordset
With myrec2
myrec2.MoveFirst
Do Until myrec2.EOF
ACTION ETC
myrec2.MoveNext
Loop
End With
If myrec1.EOF = False Then
GBL_Process = myrec1![ID] & " - " & myrec1![Subject]
GBL_Action = "A55 - MOVE next" ' & myrec1.CurrentRecord
If AuditTrail = "Yes" Then Call Audit_Trail_Globals 'xxxxxxxxxxxx Audit Trail A60
myrec1.MoveNext
Else
GBL_Process = myrec1![ID] & " - " & myrec1![Subject]
GBL_Action = "A57 - Dont MOVE"
If AuditTrail = "Yes" Then Call Audit_Trail_Globals ''xxxxxxxxxxxx Audit Audit Trail A60
End If
Loop
End With