Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hide "All" from query 1

Status
Not open for further replies.

TimTDP

Technical User
Joined
Feb 15, 2004
Messages
373
Location
ZA
I Access 2000, I have the following SQL statement for a conbo box:
SELECT DeliveryDriverId, DeliveryDriver FROM qryDrivers UNION SELECT Ast, Desc FROM tblAsterisk
ORDER BY DeliveryDriver;

If qryDrivers contains no records, the combo box still returns the Ast, Desc FROM tblAsterisk.

What is the correct syntax to have NO records returned by the combo box if qryDrivers doesn't contain any records?
 
You may try this:
SELECT DeliveryDriverId, DeliveryDriver FROM qryDrivers UNION SELECT Ast, Desc FROM tblAsterisk WHERE EXISTS(SELECT * FROM qryDrivers) ORDER BY 2

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top