A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Running & Setting Up Queries
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Edit table using union query



 
 
Thread Tools Display Modes
  #1  
Old June 1st, 2004, 07:55 AM
De'Ville
external usenet poster
 
Posts: n/a
Default Edit table using union query

I am trying to create a form for a union query that
allows me to edit the data in either of the tables used
for the query, but I can't understand why with some
queries I can edit the table and others I cant

Can anyone tell me why when I open some queries I can
edit the data in table behind the query where others
don't allow me to?

Eg here are two union queries which won't allow me to
edit the data in the table tblEnquiries for example
1.
SELECT *
FROM [tblEnquiries]
UNION SELECT *
FROM [tblIssues];

2.
SELECT [Status], [Subject]
FROM [tblEnquiries]
UNION SELECT [Status], [Subject]
FROM [tblIssues]
ORDER BY [Subject];

Where as here is an example of a query which will allows
me to edit the data in the table

SELECT tblEnquiries.Date, tblEnquiries.Status,
tblEnquiries.MainCat, tblEnquiries.SubCat,
tblEnquiries.Highlighter, tblEnquiries.EscalatedTo,
tblCustomers.CustomerType
FROM tblCustomers INNER JOIN tblEnquiries ON
tblCustomers.CustomerID = tblEnquiries.CustomerID;

Thanks in advance if you can explain why

  #2  
Old June 1st, 2004, 11:46 AM
Michel Walsh
external usenet poster
 
Posts: n/a
Default Edit table using union query

Hi,



A UNION query adds a DISTINCT, implicitly, silently, for you. A GROUP BY
query, or a query with DISTINCT, is not updateable.

A UNION ALL query could be updateable, in theory, but the design decides
to not implement that exception, so, any UNION query is not updatable.

The last query as no UNION, no GROUP BY (distinct, aggregate,
transform), and the equi-join allows to precisely know in which table, and
which record in that table, has to be updated. It is not the case if the
result is a result of a UNION, or from a GROUP BY.



Hoping it may help,
Vanderghast, Access MVP



"De'Ville" wrote in message
...
I am trying to create a form for a union query that
allows me to edit the data in either of the tables used
for the query, but I can't understand why with some
queries I can edit the table and others I cant

Can anyone tell me why when I open some queries I can
edit the data in table behind the query where others
don't allow me to?

Eg here are two union queries which won't allow me to
edit the data in the table tblEnquiries for example
1.
SELECT *
FROM [tblEnquiries]
UNION SELECT *
FROM [tblIssues];

2.
SELECT [Status], [Subject]
FROM [tblEnquiries]
UNION SELECT [Status], [Subject]
FROM [tblIssues]
ORDER BY [Subject];

Where as here is an example of a query which will allows
me to edit the data in the table

SELECT tblEnquiries.Date, tblEnquiries.Status,
tblEnquiries.MainCat, tblEnquiries.SubCat,
tblEnquiries.Highlighter, tblEnquiries.EscalatedTo,
tblCustomers.CustomerType
FROM tblCustomers INNER JOIN tblEnquiries ON
tblCustomers.CustomerID = tblEnquiries.CustomerID;

Thanks in advance if you can explain why



 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:58 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.