Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Queries / November 2005

Tip: Looking for answers? Try searching our database.

SQL Union Query - Code Not Visible

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
WildThing - 22 Nov 2005 09:46 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.