Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms Programming / January 2008

Tip: Looking for answers? Try searching our database.

Creating reports from record set

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Gary Dolliver - 31 Jan 2008 00:08 GMT
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
Carl Rapson - 31 Jan 2008 16:18 GMT
> Hi all,
> I am attempting to create a tool that will select specific records,
[quoted text clipped - 31 lines]
> thanks!
> -gary

I can't see any obvious problems. The only thing that comes to my mind is,
are you certain there's a non-Null value in Order_Id? If you hard-code a
value into the OpenReport call, does it work? And just to ask, are you
absolutely certian the field in the recordset is named Order_Id? Could it
possibly be OrderId or even Order Id (with a space)?

Carl Rapson
Gary Dolliver - 31 Jan 2008 23:53 GMT
Hi Carl,
Thanks for posting back.  After sleeping on it and coming back I found my
issue.  I noticed in the report where condition, I was calling the recordset
incorrectly - it should be rst1! where I had rst!   Arrrggghh!!!
Thank you so much again for the reply
-gary

> > Hi all,
> > I am attempting to create a tool that will select specific records,
[quoted text clipped - 39 lines]
>
> Carl Rapson
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.