Connecting Tech Pros Worldwide Forums | Help | Site Map

Question about Union Query

emandel's Avatar
Member
 
Join Date: Dec 2006
Posts: 51
#1: Nov 8 '07
Is there any way to allow me to edit information in a union query? In other words can I update information from within this query? For some reason it doesn allow me to change any information in the datasheet view of the query.

[HTML]SELECT [Last Name], [First Name], [e-mail]
FROM [From Old List]
WHERE [E-MAIL] is not null

UNION SELECT [Last Name], [First name], [e-mail]
FROM [participants]
WHERE [E-MAIL] is not null
ORDER BY [last name];[/HTML]

Jim Doherty's Avatar
Moderator
 
Join Date: Aug 2007
Location: Derbyshire,England
Posts: 639
#2: Nov 8 '07

re: Question about Union Query


Quote:

Originally Posted by emandel

Is there any way to allow me to edit information in a union query? In other words can I update information from within this query? For some reason it doesn allow me to change any information in the datasheet view of the query.

[HTML]SELECT [Last Name], [First Name], [e-mail]
FROM [From Old List]
WHERE [E-MAIL] is not null

UNION SELECT [Last Name], [First name], [e-mail]
FROM [participants]
WHERE [E-MAIL] is not null
ORDER BY [last name];[/HTML]

The short answer is no union queries are uneditable

Jim
emandel's Avatar
Member
 
Join Date: Dec 2006
Posts: 51
#3: Nov 8 '07

re: Question about Union Query


Quote:

Originally Posted by Jim Doherty

The short answer is no union queries are uneditable

Jim

Is that true even if I create another query based on that query? or isn't there a way to create a new table from a query?
Jim Doherty's Avatar
Moderator
 
Join Date: Aug 2007
Location: Derbyshire,England
Posts: 639
#4: Nov 8 '07

re: Question about Union Query


Quote:

Originally Posted by emandel

Is that true even if I create another query based on that query? or isn't there a way to create a new table from a query?


You can create a new table directly from the union query sure.

The syntax for that assuming your union query is called qryMyUnion would be:

Expand|Select|Wrap|Line Numbers
  1.  
  2. SELECT [Last Name], [First Name], [e-mail] INTO MyNewTable
  3. FROM qryMyUnion;
Go into query design simply add your union query to the design grid and
switch the query type to 'Make Table'

Obviously once its into this new table it becomes editable. The INTO bit practically speaking is the 'Make Table' query element of Access and thus the table is automatically generated.

Regards

Jim :)
Reply