Solved

can union query results be edited?

Posted on 2000-02-29
5
203 Views
Last Modified: 2007-10-18
I'm using a union query as a source for a form. "Allow Edits" on form property is "yes" and recordset type is "dynaset", but when I type something in one of the fields I get a message at the bottom saying "this recordset is not updatable". what's wrong?
0
Comment
Question by:SSF
5 Comments
 
LVL 9

Expert Comment

by:BrianWren
ID: 2570640
Are there duplicate field names in the recordsets?

It seems plausible that a union query could be updated, after all, each field is unique.  But if there are an ambiguities, that would not be the case.

Are there any calculated fields in this query, (or any of the queries)?  If so, you won't be able to update it.

What is the SQL involved?

Brian
0
 

Author Comment

by:SSF
ID: 2570664
There are a couple of IIF functions in the first query. Also, doesn't union query require the same field names in both queries? Anyway, here's the sql:

SELECT DISTINCTROW tblFD.FD_Num AS FD_Num, tblFD.BrandName AS BrandName, tblFD.[X&W_Flag] AS [X&W_Flag], tblFD.MainIndiCode AS MainIndiCode, tblFD.Mfg AS Mfg, tblATCDesc.ATCd AS ATCd, tblATCDesc.EngDesc AS EngDesc, tblFD.DoseForm AS DoseForm, tblFD.ApplRoute AS ApplRoute, tblFD.NumOfUnits AS NumOfUnits, tblFD.DoseFormUnits AS DoseFormUnits, tblFD.DoseFormType AS DoseFormType, tblFD.NumOfUnitsPerDose AS NumOfUnitsPerDose, tblFD.DoseFm AS DoseFm, tblFD.PackSize AS PackSize, tblFD.PackType AS PackType, tblFD.Phase1 AS Phase1, tblFD.EasyGCNSkip AS EasyGCNSkip, [Tbl_IDDF-DE].IDC AS IDC, [Tbl_IDDF-DE].FD_Num AS [FD#], [Tbl_IDDF-DE].LabelName AS LabelName, [Tbl_IDDF-DE].BrandName AS Brand_Name, [Tbl_IDDF-DE].MfgIdentifier AS MfgIdentifier, [Tbl_IDDF-DE].GCNSeqno AS GCNSeqno, [Tbl_IDDF-DE].RecReady AS RecReady, [Tbl_IDDF-DE].Notes AS Notes, IIf(IsNull([Tbl_IDDF-DE]![Initial]),"SYS",[Tbl_IDDF-DE]![Initial]) AS Initial, IIf(IsNull([Tbl_IDDF-DE]![AddDate]),Date(),[Tbl_IDDF-DE]![AddDate]) AS AddDate, [Tbl_IDDF-DE].ModifyDate, [Tbl_IDDF-DE].CallMfg AS CallMfg, [Tbl_IDDF-DE].NewGCNIngre AS NewGCNIngre, [Tbl_IDDF-DE].NewGCNSalt AS NewGCNSalt, [Tbl_IDDF-DE].NewGCNStr AS NewGCNStr, [Tbl_IDDF-DE].NewGCN_DF AS NewGCN_DF, [Tbl_IDDF-DE].NewGCNRt AS NewGCNRt, [Tbl_IDDF-DE].QCDate AS QCDate, Null AS iobsdte, " " AS iobsdte1, [Tbl_IDDF-DE].QCInitial AS QCInitial
FROM ((tblFD LEFT JOIN tblATCDesc ON tblFD.ATC = tblATCDesc.ATCd) LEFT JOIN [Tbl_IDDF-DE] ON tblFD.FD_Num = [Tbl_IDDF-DE].FD_Num)
ORDER BY tblFD.FD_Num

UNION SELECT DISTINCTROW [Tbl_IDDF-DE_Obsolete].FD_Num AS FD_Num, [Tbl_IDDF-DE_Obsolete].BrandName AS BrandName, [Tbl_IDDF-DE_Obsolete].[X&W_Flag], Tbl_FD.MainIndiCode AS MainIndiCode, [Tbl_HD/HI].AbbrName AS Mfg, tblATCDesc.ATCd AS ATCd, tblATCDesc.EngDesc AS EngDesc, Tbl_DoseFormDesc.DoseForm AS DoseForm, Tbl_DoseFormDesc.ApplRoute AS ApplRoute, Tbl_FD.NumOfUnits AS NumOfUnits, Tbl_FD.DoseFormUnits AS DoseFormUnits, Tbl_FD.DoseFormType AS DoseFormType, Tbl_FD.NumOfUnitsPerDose AS NumOfUnitsPerDose, Tbl_FD.DoseForm AS DoseFm, Tbl_FD.PackSize AS PackSize, Tbl_FD.PackType AS PackType, 0 AS Phase1, 0 AS EasyGCNSkip, [Tbl_IDDF-DE_Obsolete].IDC AS IDC, [Tbl_IDDF-DE_Obsolete].FD_Num AS [FD#], [Tbl_IDDF-DE_Obsolete].LabelName AS LabelName, [Tbl_IDDF-DE_Obsolete].BrandName AS Brand_Name, [Tbl_IDDF-DE_Obsolete].MfgIdentifier AS MfgIdentifier, [Tbl_IDDF-DE_Obsolete].GCNSeqno AS GCNSeqno, [Tbl_IDDF-DE_Obsolete].RecReady AS RecReady, [Tbl_IDDF-DE_Obsolete].Notes AS Notes, [Tbl_IDDF-DE_Obsolete].Initial AS Initial, [Tbl_IDDF-DE_Obsolete].AddDate AS AddDate, [Tbl_IDDF-DE_Obsolete].ModifyDate AS ModifyDate, [Tbl_IDDF-DE_Obsolete].CallMfg AS CallMfg, [Tbl_IDDF-DE_Obsolete].NewGCNIngre AS NewGCNIngre, [Tbl_IDDF-DE_Obsolete].NewGCNSalt AS NewGCNSalt, [Tbl_IDDF-DE_Obsolete].NewGCNStr AS NewGCNStr, [Tbl_IDDF-DE_Obsolete].NewGCN_DF AS NewGCN_DF, [Tbl_IDDF-DE_Obsolete].NewGCNRt AS NewGCNRt, [Tbl_IDDF-DE_Obsolete].QCDate AS QCDate,  [Tbl_IDDF-DE_Obsolete].iobsdte, [Tbl_IDDF-DE_Obsolete].iobsdte as iobsdte1, [Tbl_IDDF-DE_Obsolete].QCInitial AS QCInitial
FROM (Tbl_DoseFormDesc RIGHT JOIN ((tblATCDesc RIGHT JOIN Tbl_FD ON tblATCDesc.ATCd = Tbl_FD.ATC) LEFT JOIN [Tbl_HD/HI] ON Tbl_FD.FstMfgNum = [Tbl_HD/HI].Key) ON Tbl_DoseFormDesc.DoseFormCd = Tbl_FD.DoseFormCode) INNER JOIN [Tbl_IDDF-DE_Obsolete] ON Tbl_FD.Key = [Tbl_IDDF-DE_Obsolete].FD_Num;
0
 
LVL 57
ID: 2570668
UNION queries are not updateable.

JimD.
0
 
LVL 10

Accepted Solution

by:
paasky earned 50 total points
ID: 2570674
Hello SSF,

You can't update (edit) the records which source is union query because it's SQL specific Snapshot type Recordset.

It's not possible even there's a same table in all union select clauses or you've not used any grouping functions / calculations.

Regards,
Paasky
0
 

Author Comment

by:SSF
ID: 2570685
thanks all!
0

Featured Post

Ransomware: The New Cyber Threat & How to Stop It

This infographic explains ransomware, type of malware that blocks access to your files or your systems and holds them hostage until a ransom is paid. It also examines the different types of ransomware and explains what you can do to thwart this sinister online threat.  

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I originally created this report in Crystal Reports 2008 where there is an option to underlay sections. I initially came across the problem in Access Reports where I was unable to run my border lines down through the entire page as I was using the P…
It’s been over a month into 2017, and there is already a sophisticated Gmail phishing email making it rounds. New techniques and tactics, have given hackers a way to authentically impersonate your contacts.How it Works The attack works by targeti…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question