Update Table Using Union Query

LB79

Registered User.
Local time
Today, 19:32
Joined
Oct 26, 2007
Messages
505
Hi All,

I'm having trouble with something that should be straight forward.
I have a table with a field I want to update with the value of a Union Query

The field I want to update is Yes/No format and I can update using 0 or -1 OK.

However, when I link in the union query (and check that I only have 1 update result which is either 0 or -1) I get an error message saying that Operation must use an updatable query.
I guess this is referring to the Union Query (although I am trying to update the table and not the query.

In short – I want to update a table based on the value of a union query.

Is there a way to get around this?
Code:
UPDATE tbl_StaMe_NGR_Subscription INNER JOIN qry_QDF_QRYDEF1 ON (tbl_StaMe_NGR_Subscription.EmailType = qry_QDF_QRYDEF1.Type) AND (tbl_StaMe_NGR_Subscription.AgentEmail = qry_QDF_QRYDEF1.Email)
Code:
[FONT=Arial][COLOR=#1f497d]SET tbl_StaMe_NGR_Subscription.Subscribed = [Subscription];[/COLOR][/FONT]
 
Any query that is not updateable will make any query derived from it not updateable.

You could use separate updates based on the parts of the union query. Otherwise create a temporary table with the union query and use that in the update.

In my experience the need for union queries often indicates the data structure is not a good as it could be.

BTW "Type" is a reserved word and should not be used for names.
 

Users who are viewing this thread

Back
Top Bottom