If "Ya, but try..." means that yes, the tables are the same structure, but no,
you can't make a single table out of them (the correct design), then you might
consider a Union query. A Union query requires that each Select statement return
the same fields, in the same order. A sample:
Select StudentName, StudentGrade FROM SchoolATable
UNION
Select StudentName, StudentGrade FROM SchoolBTable
UNION
Select StudentName, StudentGrade FROM SchoolCTable...etc.
In other words, it creates a temporary result set that is essentially the
combined table. You can apply criteria to it as well. I have no idea if
UNION'ing 200 tables is acceptable or not.
----Thought #2
Sometimes you can fake people out and hide the real table structure. If you made
a combined table with a SchoolID field, say call it AllSchools, you can then
create a set of 200 queries, each specifying a specific SchoolID value. If you
name the queries whatever the 200 tables used to be called, no one need be any
the wiser (except you). Stored select queries (or views) are treated the same as
tables by forms, reports, other queries, ADO recordset commands, etc. In fact,
when you open a table "directly", the underlying database engine is just running
the implied query "Select * from TableName" anyway.
"Adrian Parker" <no@addy.com> wrote in message
news:r1*******************@news20.bellglobal.com.. .
"Stephane Richard" <st**************@verizon.net> wrote in message
news:Tk*****************@nwrdny01.gnilink.net...
You could do it all in SQL and create a temp table for the results. if
all 200 Table have the same structure (which I assume they do here, you'd need
a series of (Idealy adding perhaps a SchoolID field to a table and filtering
all records by School ID instead of having a table per school would save
you a lot of time for this :-).
Ya, but try convincing the entire Leeds & Grenville schoolboard that they
have to change their existing format :)
SELECT INTO <TempTableName> * FROM <TableName> WHERE <ListOfCriteria>
Depending on Database type (MySQL, SQL Server, Oracle, Firebird
(Interbase), Access) you could put all these queries in a stored procedure (except
Access) and execute that stored procedure passing it the search criteria
from that search form.
I am indeed using Access though. Any ideas?
<snip>
Adrian