W
Warren
I am at a loss as to why I keep getting a data type mismatch error here. The
Circuit.CircuitID field is a long integer autonumber data type, the
InstalledCircuit.CircuitID field is long integer data type, the
InstalledCircuit.Poles is a text data type and I left the default settings
for each of these respective data types of each field. The query was working
with no errors (just not with desired results) before I placed the
Circut.CircuitID Is Null in the last two If statements.
Can anyone see why I would be getting the data type mismatch?
The select statement is designed to limit values of a combo box to an
available circuit; if anyone sees a better way feel free to comment.
Also if it matters being run in A2007 on WinXPPro with all current service
packs
SELECT Circuit.CircuitID, InstalledCircuit.CircuitID, InstalledCircuit.Poles
FROM Circuit LEFT JOIN InstalledCircuit ON Circuit.CircuitID =
InstalledCircuit.CircuitID
WHERE
(((Circuit.CircuitID)=IIf([Circuit]![CircuitID]=[InstalledCircuit]![CircuitID]
And [InstalledCircuit]![Poles]="1",[Circuit]![CircuitID] Is
Null,IIf([Circuit]![CircuitID]=[InstalledCircuit]![CircuitID] And
[InstalledCircuit]![Poles]="2",[Circuit]![CircuitID] Is Null And
([Circuit]![CircuitID]+1) Is
Null,IIf([Circuit]![CircuitID]=[InstalledCircuit]![CircuitID] And
[InstalledCircuit]![Poles]="3",[Circuit]![CircuitID] Is Null And
([Circuit]![CircuitID]-1) Is Null And ([Circuit]![CircuitID]+1) Is
Null,[Circuit]![CircuitID])))))
Thank you in advance
Circuit.CircuitID field is a long integer autonumber data type, the
InstalledCircuit.CircuitID field is long integer data type, the
InstalledCircuit.Poles is a text data type and I left the default settings
for each of these respective data types of each field. The query was working
with no errors (just not with desired results) before I placed the
Circut.CircuitID Is Null in the last two If statements.
Can anyone see why I would be getting the data type mismatch?
The select statement is designed to limit values of a combo box to an
available circuit; if anyone sees a better way feel free to comment.
Also if it matters being run in A2007 on WinXPPro with all current service
packs
SELECT Circuit.CircuitID, InstalledCircuit.CircuitID, InstalledCircuit.Poles
FROM Circuit LEFT JOIN InstalledCircuit ON Circuit.CircuitID =
InstalledCircuit.CircuitID
WHERE
(((Circuit.CircuitID)=IIf([Circuit]![CircuitID]=[InstalledCircuit]![CircuitID]
And [InstalledCircuit]![Poles]="1",[Circuit]![CircuitID] Is
Null,IIf([Circuit]![CircuitID]=[InstalledCircuit]![CircuitID] And
[InstalledCircuit]![Poles]="2",[Circuit]![CircuitID] Is Null And
([Circuit]![CircuitID]+1) Is
Null,IIf([Circuit]![CircuitID]=[InstalledCircuit]![CircuitID] And
[InstalledCircuit]![Poles]="3",[Circuit]![CircuitID] Is Null And
([Circuit]![CircuitID]-1) Is Null And ([Circuit]![CircuitID]+1) Is
Null,[Circuit]![CircuitID])))))
Thank you in advance