Union Query problem

  • Thread starter Thread starter Warrio
  • Start date Start date
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?
 
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.
 
Back
Top