Quote Originally Posted by CreganTur
The issue is because of your use of the wildcard character within the DCount function. If you look at the parameters for DCount, you will see that they are DCount(expr, domain, [criteria]), and the specification for expr is the name of the Field, whose records you want to count. Wildcard character is not a Field name, so the function fails.

Replace the wildcard character with the name of a primary key field within your table named "ECH". That will count every record within the table. If you want to refine your count, then you would add parameters for the Criteria parameter.

HTH
Good thinking on that. That makes perfect sense. I should have noted that "ECH" is a query and not a table.

Basically two text files get imported into two tables. After that an unmatched query is run. Other queries are run on the results of the unmatched query. This is where the "ECH" query comes in. The DCount function needs to determine if there are records in the results of "ECH" and if there are export those results to a text file.

Hopefully that makes sense.