G
Gary Dolliver
Hi all,
I am attempting to create a tool that will select specific records,
determine whether there is an email, and depending on that will either email
or create a printable report. Here is what I have:
Dim rst1 As DAO.Recordset
Set rst1 = CurrentDb.OpenRecordset("CS_HOLD_Contact_1")
If rst1.RecordCount > 0 Then
rst1.MoveFirst
'check for email
Do Until rst1.EOF 'End of file
If IsNull(rst1!ShipTo_Email) Then
DoCmd.OpenReport "CS_Hold_Attempt_1", , , "Order_ID=" &
rst!Order_ID
rst1.MoveNext
Else
...do something...
rst1.MoveNext
End If
Loop
...do something...
Else
MsgBox "No records to process for 1st notification!", vbInformation
End If
The problem is occurring in the DoCmd.Open Report line, something with my
criteria (the Else works great) - I keep getting a 424 Object Required error
- The report is fed by the same query that is feeding the recordset. I have
a field in the report called Order_ID as well. I have been staring at this
for some time and cannot make any sense of it. Help is appreciated, thanks!
-gary
I am attempting to create a tool that will select specific records,
determine whether there is an email, and depending on that will either email
or create a printable report. Here is what I have:
Dim rst1 As DAO.Recordset
Set rst1 = CurrentDb.OpenRecordset("CS_HOLD_Contact_1")
If rst1.RecordCount > 0 Then
rst1.MoveFirst
'check for email
Do Until rst1.EOF 'End of file
If IsNull(rst1!ShipTo_Email) Then
DoCmd.OpenReport "CS_Hold_Attempt_1", , , "Order_ID=" &
rst!Order_ID
rst1.MoveNext
Else
...do something...
rst1.MoveNext
End If
Loop
...do something...
Else
MsgBox "No records to process for 1st notification!", vbInformation
End If
The problem is occurring in the DoCmd.Open Report line, something with my
criteria (the Else works great) - I keep getting a 424 Object Required error
- The report is fed by the same query that is feeding the recordset. I have
a field in the report called Order_ID as well. I have been staring at this
for some time and cannot make any sense of it. Help is appreciated, thanks!
-gary