Link to home
Start Free TrialLog in
Avatar of m_bizon
m_bizon

asked on

Creating a report based on a ADO recordset.

Is it possible, and if so how would you use an access report against an ADO recordset.  For example I have a peice of code that creates and populates an ADO recordset with all the data for a desired report.  Is it then possible to open a report, point the report to the ADO recordset and voila.
Avatar of dovholuk
dovholuk

i didn't give it a go... but here's at least ONE site that claims to do just that....

http://www.programmingmsaccess.com/Samples/VBAProcs/VBAProcsToAssignAnADORecordsetToAReport.htm

i'll try it out and get back to you...

dovholuk
I'm not sure if it is possible (It probably is, I just haven't tried it!)
My usual way of doing this sort of thing is to write the data out to a temporary table, and base the report on that (The advantage is that you can just bind the report to the table, and drag and drop your fields into the report) It can be a bit tricky in a multiuser situation though.
I believe in Access2002 you can bind a form or report directly to a recordset.

Wes
i think you can bind an ADO recordset to a form dynamically, but not a report.

drs66
Wes is correct in Access 2002 there is a recordset property that "Returns or sets the ADO Recordset or DAO Recordset object representing the record source for the specified form, report, list box control, or combo box control. Read/write."

In previous versions all people are doing is changing the recordsource so it requearies the database, probably not what you are wantiong to do.

Cheers, Andrew


No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in Community Support that this question is:
 - PAQ'd and pts removed
Please leave any comments here within the
next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER !

Nic;o)
ASKER CERTIFIED SOLUTION
Avatar of Netminder
Netminder

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial