Make a report show content from an external Database

T

TimDGCB

Hi,

I have created an interface in access witch lets the user select a
database file so he can edit this. So i have a database file with forms
and a database file with al my data. For reading in the data from my
external database I use something like folows in my Form_Load Event:

Dim db As Database
Dim qdf As QueryDef
Dim rs As Recordset

Set db = OpenDatabase("ExternDatabaseName.mdb")
Set qdf = db.CreateQueryDef("", "SELECT * FROM Table")
Set rs = qdf.OpenRecordset(dbOpenDynaset)

Set me.Recordset = RS

Now that this works in my forms I want to acomplish a similar thing to
create my reports. The sad thing is that the above code dosn't seem
work with reports. It seems to be the case that a report doesn't has
the Recordset propery. So has anyone an idee how I can solve this
problem?

Thanks:

Tim De Graeve
 
D

Duane Hookom

Is there a reason why you don't maintain linked tables?

You can create a query or modify the sql of a query to something like:

SELECT *
FROM Employees IN 'C:\Program Files\Microsoft
Office\Office10\samples\Northwind.mdb';

This would allow you to create a record source for your report.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top