Union Query WHERE criteria question

L

Ladybird

I wish to speed up the loading of a form based on a Union Query that is
based on 4 very large 120,000+ records (combined) tables and are UNIONed in
a Union Query. the form is a search form with a text box INPUT01 a Refresh
data button and the union query subform (datasheet view).
I want the form to open with no record in the subform (its quicker), and
then when I type part of the word (criteria WHERE)& then press a refresh
button, the query will return only matching records. Is this approach
correct?

Secondly if possible; can I select from a combobox on the form just one
table in the union query to search?
I have used a union query to reduce the numbers of queries and forms I would
otherwise have.
This does not work, but would it be possible?
SQL:
SELECT
[TITLE],[FORMAT],[NPRICE],[SPRICE],[CBPRICE],[TBPRICE],[COMMENTS],[UDC]
FROM [dB_1]
ORDER BY [FORMAT]
WHERE [TITLE]="Like ([forms]![Frm_FindTitles_FRM_QUER1]![INPUT01])"
UNION
SELECT
[TITLE],[FORMAT],[NPRICE],[SPRICE],[CBPRICE],[TBPRICE],[COMMENTS],[UDC]
FROM [dB_2]
WHERE [TITLE]="Like ([forms]![Frm_FindTitles_FRM_QUER1]![INPUT01])"
UNION
SELECT
[TITLE],[FORMAT],[NPRICE],[SPRICE],[CBPRICE],[TBPRICE],[COMMENTS],[UDC]
FROM [dB_3]
WHERE [TITLE]="Like ([forms]![Frm_FindTitles_FRM_QUER1]![INPUT01])"
UNION
SELECT
[TITLE],[FORMAT],[NPRICE],[SPRICE],[CBPRICE],[TBPRICE],[COMMENTS],[UDC]
FROM [dB_4]
WHERE [TITLE]="Like ([forms]![Frm_FindTitles_FRM_QUER1]![INPUT01])"
UNION
SELECT
[TITLE],[FORMAT],[NPRICE],[SPRICE],[CBPRICE],[TBPRICE],[COMMENTS],[UDC]
FROM [dB_5]
WHERE [TITLE]="Like ([forms]![Frm_FindTitles_FRM_QUER1]![INPUT01])"
UNION SELECT
[TITLE],[FORMAT],[NPRICE],[SPRICE],[CBPRICE],[TBPRICE],[COMMENTS],[UDC]
FROM [dB_6]
WHERE [TITLE]="Like ([forms]![Frm_FindTitles_FRM_QUER1]![INPUT01])";
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top