Unable to modify a query

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
 
R

Robin Proctor

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
 
Top