Union Query problem

W

Warrio

Hi, I want to do a Union query in which there would be a condition.


Ex:

Select Debit.Référence as Réf
From Debit
Where (((Debit.Référence) Like "*" & [Forms]![Motor]![Text0] & "*"))
Union
Select Credit.Référence as Réf
From Credit
Where (((Credit.Référence) Like "*" & [Forms]![Motor]![Text0] & "*"));

It tells me the following Error

Cannot use Memo, OLE, Hyperlink Object field 'Référence' in the SELECT
clause of a union Query.

When I take of the Union with Crédit it works.

Is there a way to do this Union with the condition?
 
J

John Spencer (MVP)

It might have to do with the word Reference. Try bracketing around the field
names and see if that helps. Reference is a keyword in Access.

Just a guess on my part.
 

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

Similar Threads

Union Query Select 1
Union Query and Field Alias 7
MS 2003 Parameterized Query 0
Query too complex my ass 13
Date Limit in Crosstab from Union query 2
Comlex union query question 4
UNION question 3
Union query 5

Top