Is it possible to run a loop of queries in a table full of criteria to be checked?

atksamy

New member
Local time
Today, 15:41
Joined
Oct 24, 2008
Messages
2
Hi

Hi I have a database with a table which is full of conditions and error messages for checking another databse. I want to run a loop such that each of these conditions is checked against all eth tables in the second database. and generae a report which gives teh errors . Is this possible in ms access.

eg querycrit table
id query error
1 speed<25 and speed>56 speed above limit
2 dist<56 or dist >78 dist within limit

i have more than 400 queries like this of different variables.
THe table against which I am runningtge queries is

records table
id speed dist accce decele aaa bbb ccc
1 34 44 33 33 33 33 45
2 44 55 55 55 22 23 44
regards ttk
 
This isn't that hard... but you'll have to do it in VBA.

You'll open the table in a recordset.
set up a "base" sql string - "Select *from some table where "
for each record in the recordset
extract the "query" column and put that on the end of your sql string
embed the sql string into an "INSERT INTO...."
Execute the insert into
loop to next record
 

Users who are viewing this thread

Back
Top Bottom