Re: Union Query with OLE and Memo fields?





> ... add the word ALL after the word UNION, if you don't have
> duplicates in both selects or if you don't mind them;


Sylvain,

Each of the queries return a unique set of records so, union'ing them wont
return any duplicates. *phew* :-) And following your suggestion, here is
what i got;


If Me.Form.CheckBoxAssigned = True Then
strSQL = strSQL & "UNION ALL SELECT * FROM Volunteers_Assigned "

End If

If Me.Form.CheckBoxNotAssigned = True Then
strSQL = strSQL & "UNION ALL SELECT * FROM Volunteers_NotAssigned "
End If


If Me.Form.CheckBoxRetired = True Then
strSQL = strSQL & "UNION ALL SELECT * FROM Volunteers_Retired "
End If

Me.Form.RecordSource = Mid(strSQL, 10)


...and it works like a charm! Thanks a million!!


Um, Though, i have never understood why i use the
"SELECT * FROM" statement....Cause, for example, "Volunteers_Assigned"
*is* the name of a saved query whose very first line in SQL is infact
"SELECT * FROM " So, why do we need both "SELECT * FROM"...

me.recordsource = "SELECT * FROM Volunteers_Assigned UNION ALL SELECT *
FROM Volunteers_Retired"

Why not remove one of the "SELECT * FROM";

me.recordsource = "Volunteers_Assigned UNION Volunteers_NotAssigned UNION
Volunteers_retired"

Anyways,
Cheers!
Jeff

thanks again!
.