Question about Union Query

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emandel
    New Member
    • Dec 2006
    • 65

    Question about Union Query

    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
    Recognized Expert Contributor
    • Aug 2007
    • 897

    #2
    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

    Comment

    • emandel
      New Member
      • Dec 2006
      • 65

      #3
      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?

      Comment

      • Jim Doherty
        Recognized Expert Contributor
        • Aug 2007
        • 897

        #4
        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:

        Code:
         
        SELECT [Last Name], [First Name], [e-mail] INTO MyNewTable
        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 :)

        Comment

        Working...