I have a database which runs quality queries on data before uploading it. Normally I run a series of if Dcount>0 statements on different queries where if there are any results in the query, something is wrong and the upload stops. I have one query in a newer database where trying to do dcount on it gives runtime error 3219. At first I thought it was the iif statements or query criteria based on form fields, but even after I removed them as a test the error remained. Here are the simplified queries:
qryQC2: runnable, but fails on dcount. A run-of the mill left join of table>query>table:
SELECT tblLoadCA.LCN, qryOmegaCurrent.LSACONXB, tblLoadCA.CA, O2B_LDMHP.CANUMBHP
FROM (tblLoadCA LEFT JOIN qryOmegaCurrent ON tblLoadCA.LCN = qryOmegaCurrent.LSACONXB) LEFT JOIN O2B_LDMHP ON (qryOmegaCurrent.IPN = O2B_LDMHP.IPN) AND (qryOmegaCurrent.ISN = O2B_LDMHP.ISN);
qryOmegaCurrent: Can be dcounted without error. The 'middle' query joined in the first query. Just 4 joined tables:
SELECT O2B_LDMXA.EIACODXA, O2B_LDMXB.LSACONXB, O2B_LDMHG.PLISNOHG, O2B_LDMHA.CAGECDXH, O2B_LDMHA.REFNUMHA, O2B_LDMHG.ISN, O2B_LDMHG.IPN
FROM ((O2B_LDMXA INNER JOIN O2B_LDMXB ON O2B_LDMXA.IEN = O2B_LDMXB.IEN) INNER JOIN O2B_LDMHG ON O2B_LDMXB.ISN = O2B_LDMHG.ISN) INNER JOIN O2B_LDMHA ON O2B_LDMHG.IPN = O2B_LDMHA.IPN;
Anything that's O2B_ is an external ODBC database. I've done several things like this and never encountered the error. Why doesn't this work?