Re: Union Query with OLE and Memo fields?
- From: "WebDude" <WebDude@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 28 Jul 2005 22:11:03 -0700
> ... 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!
.
- Follow-Ups:
- Re: Union Query with OLE and Memo fields?
- From: Sylvain Lafontaine
- Re: Union Query with OLE and Memo fields?
- References:
- Union Query with OLE and Memo fields?
- From: WebDude
- Re: Union Query with OLE and Memo fields?
- From: Sylvain Lafontaine
- Union Query with OLE and Memo fields?
- Prev by Date: Re: Union Query with OLE and Memo fields?
- Next by Date: Re: Union Query with OLE and Memo fields?
- Previous by thread: Re: Union Query with OLE and Memo fields?
- Next by thread: Re: Union Query with OLE and Memo fields?
- Index(es):