Hi, As the subject suggests I have an SQL Union Query which runs fine and
produces the results I needed.
I now need to alter this code to change / add / remove fields but when I go
to design the SQL Code - there is no code visible and nothing to highlight
and copy out - but the query does run fine.
Can anybody help get my code back as it was quite lengthy.
Thanks.
Jeff Boyce - 22 Nov 2005 12:14 GMT
I can think of at least four different places I could stick a SQL UNION
query expression. Where's yours?

Signature
More info, please ...
Jeff Boyce
<Office/Access MVP>
> Hi, As the subject suggests I have an SQL Union Query which runs fine and
> produces the results I needed.
[quoted text clipped - 6 lines]
>
> Thanks.
WildThing - 23 Nov 2005 08:34 GMT
Hi, Plenty of places i'd like to stick it at the moment but its currently in
Access 2000.
> I can think of at least four different places I could stick a SQL UNION
> query expression. Where's yours?
[quoted text clipped - 10 lines]
> >
> > Thanks.
Jeff Boyce - 23 Nov 2005 13:06 GMT
OK, in a (as a) query (top candidate, since you posted in the queries
newsgroup), as a SQL statement in code "behind a form", or "behind a
report", or in a code module?

Signature
Regards
Jeff Boyce
<Office/Access MVP>
> Hi, Plenty of places i'd like to stick it at the moment but its currently in
> Access 2000.
[quoted text clipped - 13 lines]
> > >
> > > Thanks.
John Spencer - 23 Nov 2005 12:56 GMT
Assuming that your union query is a saved query - it has a name in the
queries collection. You might be able to recover the text (if it exists)
using someVBA similar to:
Currentdb.QueryDefs("query1").SQL
You can type that in the VBA immediate window as
?Currentdb.QueryDefs("query1").SQL
and after pressing Enter key you should get the text of the SQL, which you
can then copy and paste.
If this returns nothing, then I would start checking to see if the query
that is executing is being created in a module, is the record source of a
form that you are using, etc.
> Hi, As the subject suggests I have an SQL Union Query which runs fine and
> produces the results I needed.
[quoted text clipped - 7 lines]
>
> Thanks.