O'Reilly logo

Access 2002 Programming by Example by Bob Villareal

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Importing and Exporting Data

That is the scenario that you are supposedly facing. You can tackle the last problem first. First of all, your entire solution can be handled with one form. To query another database, consider the IN clause that you can either run from a RunSQL action or directly as a row source. Here is a typical SQL statement:

SELECT * from Customers; 

To make the query run from another database, you simply add the IN clause with the database and path in quotes:

SELECT * from Customers IN "C:\AccessByExample\Northwind.mdb" 

The following is another syntax that produces the same results:

SELECT * from [C:\AccessByExample\Northwind.mdb].Customers 

Applying this to the subject at hand, the following SQL string is the row source ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required