no1biscuit
Programmer
I am using docmd.runsql and only get an error when I add in the where clause. I have a feeling it is thinking the where is part of the insert statement and not the select statement. Any Ideas?
insert into tblInspectionDevices(InspectionID, Node, Loop, DeviceType, Address, Description, ExtendedDescription, DateTested, PassFail, ModuleDetector)
SELECT " & strinspectionid & ",SystemDeviceData.NodeAddress, SystemDeviceData.LoopSelection, DeviceTypeID.TypeCodeLabel,
SystemDeviceData.DeviceAddress, SystemDeviceData.DeviceLabel, SystemDeviceData.ExtendedLabel, Null AS DateTested, 'Not Tested' AS PassFail, IIf([IsDetector]=-1,'D','M') AS ModuleDetector
FROM SystemDeviceData INNER JOIN DeviceTypeID ON SystemDeviceData.TypeID = DeviceTypeID.TypeID
WHERE SystemDeviceData.LoopSelection <> 0
in '" & txtfilepath.Text & "'
insert into tblInspectionDevices(InspectionID, Node, Loop, DeviceType, Address, Description, ExtendedDescription, DateTested, PassFail, ModuleDetector)
SELECT " & strinspectionid & ",SystemDeviceData.NodeAddress, SystemDeviceData.LoopSelection, DeviceTypeID.TypeCodeLabel,
SystemDeviceData.DeviceAddress, SystemDeviceData.DeviceLabel, SystemDeviceData.ExtendedLabel, Null AS DateTested, 'Not Tested' AS PassFail, IIf([IsDetector]=-1,'D','M') AS ModuleDetector
FROM SystemDeviceData INNER JOIN DeviceTypeID ON SystemDeviceData.TypeID = DeviceTypeID.TypeID
WHERE SystemDeviceData.LoopSelection <> 0
in '" & txtfilepath.Text & "'