D
dch3
The SUB QUERY below has been saved as 'qry_Loading_Trailers' referenced in
the MAIN QUERY. The MAIN QUERY is destined for the row source of a combo box.
Given the nature of the data being worked with I would prefer NOT to have
either query exposed to any snooping users. How would I alter the main query
to embed the actual SQL Statement of the other.
'MAIN QUERY
SELECT tblTrailerInventory.txtTrailerDOTNumber, qry_Loading_Trailers.[DOT
Number]
FROM tblTrailerInventory LEFT JOIN qry_Loading_Trailers ON
tblTrailerInventory.txtTrailerDOTNumber = qry_Loading_Trailers.[DOT Number]
WHERE (((qry_Loading_Trailers.[DOT Number]) Is Null))
ORDER BY tblTrailerInventory.txtTrailerDOTNumber;
'SUB QUERY
SELECT DISTINCTROW tblTrailerInventory.txtTrailerDOTNumber AS [DOT Number],
tblTrailerInventory.txtTrailerInternalNumber AS [Internal Number]
FROM tblTrailerInventory LEFT JOIN tblTrailerActivityHeaders ON
tblTrailerInventory.txtTrailerDOTNumber =
tblTrailerActivityHeaders.txtTrailerDOTNumber
WHERE (((tblTrailerActivityHeaders.txtTrailerLoadStatus)="Loading")) OR
(((tblTrailerActivityHeaders.txtTrailerLoadStatus)="Ready for Dispatch") AND
((tblTrailerActivityHeaders.txtTrailerDispatchStatus)="Ready for Dispatch"))
ORDER BY tblTrailerInventory.txtTrailerDOTNumber;
the MAIN QUERY. The MAIN QUERY is destined for the row source of a combo box.
Given the nature of the data being worked with I would prefer NOT to have
either query exposed to any snooping users. How would I alter the main query
to embed the actual SQL Statement of the other.
'MAIN QUERY
SELECT tblTrailerInventory.txtTrailerDOTNumber, qry_Loading_Trailers.[DOT
Number]
FROM tblTrailerInventory LEFT JOIN qry_Loading_Trailers ON
tblTrailerInventory.txtTrailerDOTNumber = qry_Loading_Trailers.[DOT Number]
WHERE (((qry_Loading_Trailers.[DOT Number]) Is Null))
ORDER BY tblTrailerInventory.txtTrailerDOTNumber;
'SUB QUERY
SELECT DISTINCTROW tblTrailerInventory.txtTrailerDOTNumber AS [DOT Number],
tblTrailerInventory.txtTrailerInternalNumber AS [Internal Number]
FROM tblTrailerInventory LEFT JOIN tblTrailerActivityHeaders ON
tblTrailerInventory.txtTrailerDOTNumber =
tblTrailerActivityHeaders.txtTrailerDOTNumber
WHERE (((tblTrailerActivityHeaders.txtTrailerLoadStatus)="Loading")) OR
(((tblTrailerActivityHeaders.txtTrailerLoadStatus)="Ready for Dispatch") AND
((tblTrailerActivityHeaders.txtTrailerDispatchStatus)="Ready for Dispatch"))
ORDER BY tblTrailerInventory.txtTrailerDOTNumber;