Solved

Update on Access?

Posted on 2012-03-12
8
224 Views
Last Modified: 2012-03-13
Hi,

I'm trying to do an update on access, but I keep getting "Operation must use an updateable query"

I have full access to the table that I'm trying to do updates on, and on some REAL simple updates, it seems to go through.  

Basically I have a table A that contains client info (name, etc.. and also updateuser, updatedate)
Table B contains the clientname, updateuser, rundate
I first try to find the latest run dates of each clients so I have a query called C:
SELECT a.*
FROM B as a, (SELECT clientname, max(rundate) as latest_date FROM B GROUP BY clientname) as F
WHERE a.clientName = F.clientName and a.rundate = f.latest_date

So basically I'm just trying to update the table to include the latest user and the date...  
I believe the issue has to do with me trying to update from a query that includes grouping...  Any idea how to get around this?  Thanks!



I want to update the
0
Comment
Question by:iamnamja
8 Comments
 

Expert Comment

by:gnetgnet
Comment Utility
It is the join it doesnt like. Can you find the keys and after that update the row with the data you want.
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
see this link for reasons and possible solution

http://msdn.microsoft.com/en-us/library/aa198446%28office.10%29.aspx
0
 
LVL 119

Expert Comment

by:Rey Obrero
Comment Utility
0
 

Author Comment

by:iamnamja
Comment Utility
Ok...

so according to: http://allenbrowne.com/ser-61.html

It's a read only when there's a group by...  But it has group by on the other table that i'm trying to take values from and not on the table that i'm trying to update.

Why would this cause an issue?
0
Get up to 2TB FREE CLOUD per backup license!

An exclusive Black Friday offer just for Expert Exchange audience! Buy any of our top-rated backup solutions & get up to 2TB free cloud per system! Perform local & cloud backup in the same step, and restore instantly—anytime, anywhere. Grab this deal now before it disappears!

 
LVL 30

Expert Comment

by:hnasr
Comment Utility
Supply an example demonstrating the problem.
0
 
LVL 77

Accepted Solution

by:
peter57r earned 500 total points
Comment Utility
'It's a read only when there's a group by...  But it has group by on the other table that i'm trying to take values from and not on the table that i'm trying to update.'

I'm afraid that even though your logic is fine, it doesn't alter reality.
Any query involving a GroupBy anywhere in its structure is regarded as non-updateable by Access.

You can use a DMax() function instead of the subquery as the update value.
0
 
LVL 84
Comment Utility
Can you post the SQL of your Update query here?
0
 

Author Closing Comment

by:iamnamja
Comment Utility
Thanks all, I have decided to go by dmax which seems to work fine.  Thanks.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction When developing Access applications, often we need to know whether an object exists.  This article presents a quick and reliable routine to determine if an object exists without that object being opened. If you wanted to inspect/ite…
Experts-Exchange is a great place to come for help with solutions for your database issues, and many problems are resolved within minutes of being posted.  Others take a little more time and effort and often providing a sample database is very helpf…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.

762 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now