Hello,
I am using the following union query to search serial numbers from 5 different tables.
SELECT[WORKSTATION].UnitModel,UnitPart,UnitSerial,PONum
FROM[WORKSTATION]
WHERE(((WORKSTATION].UnitSerial)=[Enter Serial No.]))
UNION ALL
SELECT[LAPTOP].UnitModel,UnitPart,UnitSerial,PONum
FROM[LAPTOP]
WHERE(((LAPTOP].UnitSerial)=[Enter Serial No.]))
UNION ALL
SELECT[SERVER].UnitModel,UnitPart,UnitSerial,PONum
FROM[SERVER]
WHERE(((SERVER].UnitSerial)=[Enter Serial No.]))
UNION ALL
SELECT[UPS].UnitModel,UnitPart,UnitSerial,PONum
FROM[UPS]
WHERE(((UPS].UnitSerial)=[Enter Serial No.]))
It works beautifully. However, in order to do a new search I have to close the query and open it again to run a new search.
How does one add a prompt in SQL to "Search another Serial Number" where a yes answer would re-run the query and a no answer would close it?
I would be most grateful for any help. THANK YOU!
I am using the following union query to search serial numbers from 5 different tables.
SELECT[WORKSTATION].UnitModel,UnitPart,UnitSerial,PONum
FROM[WORKSTATION]
WHERE(((WORKSTATION].UnitSerial)=[Enter Serial No.]))
UNION ALL
SELECT[LAPTOP].UnitModel,UnitPart,UnitSerial,PONum
FROM[LAPTOP]
WHERE(((LAPTOP].UnitSerial)=[Enter Serial No.]))
UNION ALL
SELECT[SERVER].UnitModel,UnitPart,UnitSerial,PONum
FROM[SERVER]
WHERE(((SERVER].UnitSerial)=[Enter Serial No.]))
UNION ALL
SELECT[UPS].UnitModel,UnitPart,UnitSerial,PONum
FROM[UPS]
WHERE(((UPS].UnitSerial)=[Enter Serial No.]))
It works beautifully. However, in order to do a new search I have to close the query and open it again to run a new search.
How does one add a prompt in SQL to "Search another Serial Number" where a yes answer would re-run the query and a no answer would close it?
I would be most grateful for any help. THANK YOU!