Re: Last record search not working

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



I have used this procedure on other tables with success.

That's the trouble: LAST is just reliable enough to trick you into thinking
it works, then BAM ... It may have been the compact and repair which
resorted the recordset: is there also a primary key field? The compact
and repair was always going to happen one day, but even if you don't
have another primary key, one day you were going to find a query that
lost the natural sort order and gave this problem.

Worse, the help is misleading: LAST never works properly even if
you specify a sort order. The problem isn't really that recordsets have
an undefined sort order: if you are getting your records from an MDB,
the records always, as it happens, have a well defined sort order,
although not always what you expected.

The intractable problem is that LAST is not always applied in the
correct place in a complex set of subqueries: sometimes the query
plan builder puts it in the wrong place, before the relevant sort has
been done, or after the records have been joined to another table.

(david)

"Dave Couch" <DaveCouch@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:423A7E81-23E5-4ECC-84D4-6D8F0BD2FF2A@xxxxxxxxxxxxxxxx
Access 2003. I have a table with 1831 records with a last key index value
(ProposalID) of 1831. I have set up a query to select the last record in
the
table. I am using the "Last" selection in the Total row. When I run the
query, it will only show record 1816, not the last record. I have tried
recreating the query with no luck. All of the data in the fields looks
correct and the ID field is an "autonumber" field. I have used this
procedure on other tables with success. I can't figure out what is wrong
with this table. I did a "compact and repair" on the database. Any ideas
out there?

Dave


.



Relevant Pages

  • Re: FORM DIED - form based on query no longer opens to correct rec
    ... try Compact & Repair. ... If that doesn't work, I rebuild the form! ... query can read it. ...
    (microsoft.public.access.forms)
  • Re: Weird issue
    ... Yes, I do have a backup, but I ... I was woking on a database and attempted to open an update query in design ... Have you tried Compact and Repair? ...
    (microsoft.public.access.queries)
  • Re: Getting error re: table that was deleted
    ... When trying to update the field in a query I ... Hash: SHA1 ... Run the Tools> Database Utilities> Compact & Repair routine. ...
    (microsoft.public.access.queries)
  • Re: Wrong result from INNER JOIN query if not sorting.
    ... I compacted and repair the db. ... Even if I inculde the ORDER BY command, query still returns wrong result. ... Try a compact & repair. ... There is Customers and Inventory table. ...
    (microsoft.public.access.queries)
  • Re: design: single or multiple queries
    ... same query by varying the selection conditions and sort order. ... or move to MySQL or SQL Server. ... How does the query OrderBy property relate to the Sort specs shown ...
    (microsoft.public.access.queries)