This topic is locked

Update records from a Query?

9/25/2007 8:24:26 AM
ASPRunnerPro General questions
B
Bryan author

Hi,
Apologies in advance for the long post!
I have a table (called ACTION) with example records such as:
Matter Number|Date Due|Complete|Diary Item

12345|10/09/07|Yes|Have we received report from client?

67890|15/09/07|No|Check file for audit

12345|03/10/07|No|Ring client for update

12345|04/10/07|No|File papers with supplier

67890|12/10/07|No|Order update stock

22334|15/10/07|No|Stock update: PN 334594
etc
I have a query that just lists the earliest entry for each matter, only showing items that are not Completed. Eg:
67890|15/09/07|No|Check file for audit

12345|03/10/07|No|Ring client for update

22334|15/10/07|No|Stock update: PN 334594
Query:

SELECT Action.[Matter Number], Action.[Matter Name], Min(Action.[Date Due]) AS [Date Due], First(Action.ID) AS ID, First(Action.[Diary Item]) AS [Diary Item], Action.[File Holder], Action.Complete, First(Action.[Schedule code]) AS [Schedule code], Action.FELink

FROM [Action]

GROUP BY Action.[Matter Number], Action.[Matter Name], Action.[File Holder], Action.Complete, Action.FELink

HAVING (((Action.Complete)="No"))

ORDER BY First(Action.ID);
There is then a link to the Action table which provides the Ajax view of all future entries per matter.
This acts as my main List page and it works fine.
What I now want to achieve is to add the Complete field to this list and be able to Inline Edit it.
Eg:
Matter|Date due|Complete|Diary Item

67890|15/09/07|No|Check file for audit

12345|03/10/07|No|Ring client for update

22334|15/10/07|No|Stock update: PN 334594
So, when I change the above value for matter 12345 to Completed=Yes, the view should refresh itself with the next value for 12345. Eg:
Matter|Date due|Complete|Diary Item

67890|15/09/07|No|Check file for audit

12345|04/10/07|No|File papers with supplier

22334|15/10/07|No|Stock update: PN 334594
Is there anyway this can be achieved? Simply turning on Inline edit for the field produces an error "Record was NOT edited. [Microsoft][ODBC Microsoft Access Drive] Cannot update. Database or object is read only"
Is this because the query is grouped and therefore wont allow updates? If so, is there a workaround?
Any advice would be appreciated.
Thanks,

Bryan

Sergey Kornilov admin 9/26/2007

Bryan,
you cannot edit GROUP BY query. This is an aggregated view, it's not editable.