April15Hater
Accountant
- Local time
- Today, 16:14
- Joined
- Sep 12, 2008
- Messages
- 349
Hi,
I'm trying to make use of the UNION SQL command, but I can't quite seem to get it to work. Here's my Code:
WhenI take out the union and the second query, it returns a record (working right). But when I add the Union, it loses the one record. Any ideas of what I could be doing wrong??
I'm trying to make use of the UNION SQL command, but I can't quite seem to get it to work. Here's my Code:
Code:
SELECT tblProductionTracking.ProductionTrackingID, tblProductionTracking.FunctionTrackingID, tblProductionTracking.TrackingNumber, tblProductionTracking.TrackingOnly, tblProductionInput.ProductionID
FROM tblProductionInput INNER JOIN tblProductionTracking ON tblProductionInput.ProductionID = tblProductionTracking.ProductionID
WHERE (((tblProductionTracking.FunctionTrackingID)=[Forms]![frmProductionStep3b]![cboTrackableSel]) AND ((tblProductionTracking.ProductionID)=[Forms]![frmProductionStep3b]![txtProductionID]))
UNION
SELECT tblProductionStep3blstTracking.ProductionTrackingID, tblProductionStep3blstTracking.FunctionTrackingID, tblProductionStep3blstTracking.TrackingNumber, tblProductionStep3blstTracking.TrackingOnly, tblProductionStep3blstTracking.ProductionID
FROM tblProductionStep3blstTracking WHERE (((tblProductionTracking.FunctionTrackingID)=[Forms]![frmProductionStep3b]![cboTrackableSel]) AND ((tblProductionTracking.ProductionID)=[Forms]![frmProductionStep3b]![txtProductionID]));