How to make a query Crash on conditions?

techexpressinc

Registered User.
Local time
Today, 13:48
Joined
Nov 26, 2008
Messages
185
I have two tables with one field name all that is one should be in the other. When this is not true, i want the query to crash, abend not run to a smooth end.

Reason being to stop the processing of a report that is based on the query.

Any idea of how I can do this.

I have attached a picture, as it is worth a thousand words. The name field needs in both tables and being matching. If there is not a match I want the query to crash burn and no report.

Thx for all and any good ideas. Russ
 

Attachments

  • Access-wanting-a-query-crash-v030810.JPG
    Access-wanting-a-query-crash-v030810.JPG
    28.2 KB · Views: 115
I'm not sure wanting the query to crash is the right way to look at it. I would think with the proper joins, the query would return no records, which you then handle with the No Data event of the report.
 
Also, you should rename the field NAME in your tables as that is an Access Reserved Word (and a particularly sticky one at that).
 
Re: No Data Event maybe?? - more info

More info - This is a billing report. And I only get a once a month complete data load of employees.

Then, during the month new people might join. I do activity dumps weekly and if any new employees are added I do not know.

Currently, if the billing/activity reports are run and when a new person is added in the activity, they are not on the table of employees. My query/report runs to a good end, but excludes the new person(s).

I need the report to not run or have a BIG red flag when a person is on the activity dump but not in the employee file; not just exclude that person from getting paid. This was/is a big problem..

Thx Russ
 
I think the OP wants to stop/break a long query during execution

try ctrl-break during execution - but it may not stop the query running

or kill access (drastic!)
 
Suggestion:

1. Create a function to print each page.
2. Put the printing in a loop to the max number of pages.
3. Set a boolean flag (initialised to True) that the loop will check against for every page printed.

Set the flag to False if a condition fails and that will effectively pause your printing. Forgot to mention the variable should be declared as a global variable?

Big job if you want to follow this route.
------------------------------------------

Suggestion 2:
Couldn't you run an unmatched query at the end of printing?
 
Last edited:

Users who are viewing this thread

Back
Top Bottom