Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 68321
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T19:23:53+00:00 2026-05-10T19:23:53+00:00

I have a database with a table which is full of conditions and error

  • 0

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

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 running the queries is

records table

id   speed     dist    accce   decele   aaa   bbb     ccc 1     33        34      44         33   33     33      33 2     45        44      55         55   55     22      23 

regards ttk

  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T19:23:54+00:00Added an answer on May 10, 2026 at 7:23 pm

    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 .

    Dim rs As DAO.Recordset Dim rs2 As ADODB.Recordset  Set rs = CurrentDb.OpenRecordset('querycrit') Set rs2 = CreateObject('ADODB.Recordset') rs2.ActiveConnection = CurrentProject.Connection For Each tdf In CurrentDb.TableDefs 'EDIT: TableDefs includes Microsoft System tables and ' 'these should never be tampered with. They all begin with Msys ' 'so we can leave them out of the loop here. '    If Left(tdf.Name, 4) <> 'msys' And tdf.Name <> 'querycrit' Then         rs.MoveFirst         strSQL = 'SELECT * From [' & tdf.Name & '] WHERE '          Do While Not rs.EOF             On Error Resume Next             Debug.Print tdf.Name             rs2.Open strSQL & ' ' & rs![query]             If Err.Number = 0 Then                 On Error GoTo 0                 If Not rs2.EOF Then                     Debug.Print rs![Error]                     Debug.Print rs2.GetString                 End If             End If             Err.Clear             rs2.Close             rs.MoveNext          Loop     End If Next End Sub 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database structure that has a Person table which contains fields such
I have a database table which is full-text indexed and i use the CONTAINS-function
I have a database table (named Topics) which includes these fields : topicId name
I have a database table called Posts which stores all the information regarding an
I have a string column in a database table which maps to an Enum
In a SQL server database, I have a table which contains a TEXT field
I have a database (NexusDB (supposedly SQL-92 compliant)) which contains and Item table, a
I have an Access database in which I drop the table and then create
I have a table in my database which stores a tree structure. Here are
I have many tables in my database which are interrelated. I have a table

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.