Hi,
I have a fairly basic query based on a single main table 'Quotations'. The query has a join to a subquery which contains 2 further subqueries which are 'Totals' queries which enable the sum cost of all products in one and labour hours in another which are then combined to give the 'Quote Total Value' for each individual quote record.
I need to display a list of all the quotes in a datasheet form which I have done and all is fine. However I want to be able to edit one of the fields ([Quotations].[CopyQuote]) that exists in the main 'Quotations' table but it won't let me. I understand that you cannot edit a 'totals' query but I am not trying to edit a field from the subquery so assumed that I would be able to do so?
As soon as I remove the subquery that contains the 'totals' sub-queries it allows editing. Is there any way round this as it wouldn't be possible to create the Quote total value without using a totals query? SQL below:
I have a fairly basic query based on a single main table 'Quotations'. The query has a join to a subquery which contains 2 further subqueries which are 'Totals' queries which enable the sum cost of all products in one and labour hours in another which are then combined to give the 'Quote Total Value' for each individual quote record.
I need to display a list of all the quotes in a datasheet form which I have done and all is fine. However I want to be able to edit one of the fields ([Quotations].[CopyQuote]) that exists in the main 'Quotations' table but it won't let me. I understand that you cannot edit a 'totals' query but I am not trying to edit a field from the subquery so assumed that I would be able to do so?
As soon as I remove the subquery that contains the 'totals' sub-queries it allows editing. Is there any way round this as it wouldn't be possible to create the Quote total value without using a totals query? SQL below:
Code:
SELECT Quotations.QuoteNumber, Quotations.QuoteDate, Quotations.EmployeeID, Quotations.CustomerID, Quotations.SiteID, Quotations.QuoteName, IIf([QuoteType]=1,"Job New",IIf([QuoteType]=2,"Maintenance",IIf([QuoteType]=6,"Maintenance Renewal",IIf([QuoteType]=4,"Job Variation",IIf([QuoteType]=5,"Remedials"))))) AS QuoteTypeName, IIf([Discipline]=1,"FIRE",IIf([Discipline]=2,"EVC",IIf([Discipline]=3,"SUPPRESSION",IIf([Discipline]=4,"EXTING",IIf([Discipline]=5,"ELIGHTS",IIf([Discipline]=6,"N/CALL",IIf([Discipline]=7,"FRA",IIf([Discipline]=8,"INTRUDER",IIf([Discipline]=9,"ACCESS",IIf([Discipline]=10,"CCTV",IIf([Discipline]=11,"MONITORING",IIf([Discipline]=12,"REMEDIALS","UNKNOWN")))))))))))) AS DisciplineName, CCur(Nz([QuoteTotal],0)) AS QuoteTotalValue, Quotations.CopyQuote, Quotations.QuoteID
FROM Quotations LEFT JOIN qselQuoteTotal ON Quotations.QuoteNumber = qselQuoteTotal.QuoteNumber
WHERE (((Quotations.QuoteType) Is Not Null) AND ((Quotations.Discipline) Is Not Null));