I have a database with a table which is full of conditions and error messages for checking another database. I want to run a loop such that each of these conditions is checked against all the tables in the second database and generae a report which gives the errors. Is this possible in ms access. For example, querycrit table
I have more than 400 queries like this of different variables. THe table against which I am running the queries is records table
regards ttk
Taryn 238k55 gold badges362 silver badges403 bronze badges asked Oct 24, 2008 at 10:36
Here is some more sample code. It illustrates the use of two different types of recordsets. You may wish to read VBA Traps: Working with Recordsets by Allen Browne and List of reserved words in Access 2002 and in later versions of Access .
answered Oct 24, 2008 at 13:09
FionnualaFionnuala 89.8k7 gold badges108 silver badges145 bronze badges 2 When you say "report", do you mean an Access Report, or would writing to a file or Access Form work? You can create a function or sub in a Module to do this. Open a recordset on your querycrit table and spin through the records dynamically building and running the SQL for the records table. You can write the results of these dynamic queries to a file, or a form, or insert the results into a temp table and drive the Access Report from there. answered Oct 24, 2008 at 11:01
Patrick CuffPatrick Cuff 27.8k11 gold badges67 silver badges94 bronze badges
The correct think to do, I think, would be to create a table of tables and a query-table junction table that shows which queries are to be run on which table, for example:
This can the be used to run the correct set of queries on each table. answered Oct 24, 2008 at 12:12
FionnualaFionnuala 89.8k7 gold badges108 silver badges145 bronze badges Here is some sample code, it is typed, not tested.
answered Oct 24, 2008 at 11:20
FionnualaFionnuala 89.8k7 gold badges108 silver badges145 bronze badges |