Hey all,
This may be the dumbest thing I've ever seen. I'm creating a queryDef in VBA for access. Here's a sample of the query it creates:
Now here's the kicker, if I open the query it doesn't show any results. BUT (and this is wild) if I change anything it will display. Say I enter the query designer and show, and then rehide something, change the one column to "Critica" instead of "Critical", ANYTHING - It will display the proper results!
I have no idea why this could happen. it happened once I put in the conditional above that reads " ((tblSignifican t.field) Is Null Or (tblSignificant .field)='Chromi um'))", but I need it there. Until I put that in everything was working fine. I thought that maybe "field" was a reserved word so I just tried changing it to "fieldName" and it still doesn't work.
Help! :(
This may be the dumbest thing I've ever seen. I'm creating a queryDef in VBA for access. Here's a sample of the query it creates:
Code:
SELECT tblEquipment.equipmentID, tblSample.sampleDate, tblSampleResults.Chromium, IIf([x]=True,'X',(IIf([U]=True,'U',' '))) AS Critical FROM (((tblEquipment INNER JOIN tblCompartment ON tblEquipment.[equipmentID] = tblCompartment.[equipmentID]) INNER JOIN tblSample ON tblCompartment.[compartmentAutoID] = tblSample.[compartmentSpecific]) INNER JOIN tblSampleResults ON tblSample.[sampleNumber] = tblSampleResults.[sampleCode]) LEFT JOIN tblSignificant ON tblSampleResults.sampleID = tblSignificant.sampleCode WHERE (((tblEquipment.equipmentID)=31757 Or (tblEquipment.equipmentID)=31774 Or (tblEquipment.equipmentID)=39858 Or (tblEquipment.equipmentID)=39879 Or (tblEquipment.equipmentID)=52718 Or (tblEquipment.equipmentID)=52832 Or (tblEquipment.equipmentID)=52841 Or (tblEquipment.equipmentID)=52842 Or (tblEquipment.equipmentID)=52843 Or (tblEquipment.equipmentID)=81076 Or (tblEquipment.equipmentID)=89801 Or (tblEquipment.equipmentID)=102055 Or (tblEquipment.equipmentID)=102850 Or (tblEquipment.equipmentID)=109801 Or (tblEquipment.equipmentID)=109898 Or (tblEquipment.equipmentID)=109919 Or (tblEquipment.equipmentID)=109920 Or (tblEquipment.equipmentID)=111722 Or (tblEquipment.equipmentID)=121301 Or (tblEquipment.equipmentID)=190860 Or (tblEquipment.equipmentID)=190933 Or (tblEquipment.equipmentID)=239817 Or (tblEquipment.equipmentID)=372013 Or (tblEquipment.equipmentID)=372053 Or (tblEquipment.equipmentID)=372227 Or (tblEquipment.equipmentID)=379908) AND ((tblSample.sampleDate)>=#3/3/2007# And (tblSample.sampleDate)<=#12/11/2009#) AND ((tblCompartment.compartmentCode)=1) AND ((tblSignificant.field) Is Null Or (tblSignificant.field)='Chromium')) ORDER BY tblEquipment.equipmentID;
I have no idea why this could happen. it happened once I put in the conditional above that reads " ((tblSignifican t.field) Is Null Or (tblSignificant .field)='Chromi um'))", but I need it there. Until I put that in everything was working fine. I thought that maybe "field" was a reserved word so I just tried changing it to "fieldName" and it still doesn't work.
Help! :(
Comment