union query with List Box

delamerbleu

Registered User.
Local time
Today, 13:40
Joined
Nov 27, 2005
Messages
15
I want query two tablews with a list box. I have written a code, which work. Pl help!

Two tables: Tbl_ResearchLog and Tbl_AdvocacyLog_NY
Query Form (with an unbound list box by Category, and an command button leading to a pre-set SQL Query): FormQryCate

In the SQL view of the query, the statement is as below:

SELECT DocuType, Title_eng, FileLocat_eng, Category, "HK" AS Product
FROM Tbl_ResearchLog
UNION SELECT DocuType, Title_eng, FileLocat_eng, Category, "NY" AS Product
FROM [Tbl_AdvocacyLog_NY]
WHERE (((Tbl_ResearchLog.Category) Like [Forms]![FormQryCate]![cboUqryCate])
AND ((Tbl_AdvocacyLog_NY.Category) Like [Forms]![FormQryCate]![cboUqryCate]))
ORDER BY DocuType;

Is it wrong? I need to it urgently. Pls Pls Help.! Also, if i want to make the list in multi-select, will the code be different?
 

Users who are viewing this thread

Back
Top Bottom