Unable to modify a query

  • Thread starter Thread starter Chris
  • Start date Start date
C

Chris

I'm working with Access 97.
I have created a query that return me the last "user" of
the table to allow me to change a value in this record.
My problem is that Access says me that the recordset in
not updatable.

My query is like this :
SELECT Last(TblUser.UserID) AS UserID, Last
(TblUser.Salary) AS Salary
FROM TblUser
WITH OWNERACCESS OPTION;

Any idea ?
Thanks in advance.
Chris
 
Your query is an aggregate query (using the Last function) and is by
definition not updateable. The sort order is also undefined so which
record is 'last' is not predictable. Try using a subquery:

SELECT UserID, Salary FROM tblUser
WHERE UserID=(SELECT Max(UserID) FROM tblUser)

This assumes the 'last' user has the highest UserID.

Robin Proctor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top