Last function Not workiong...

pablavo

Registered User.
Local time
Today, 12:47
Joined
Jun 28, 2007
Messages
189
Hi folks,

I have a form that uses a text box that lists the last value from one of the fields. The text box has an underlying query that uses the last function to list the last value.

it was working before, when I entered a value, along with requery, the textbox would change to that last value. Now it does nothing

I went into the table, made up new records, made a new query with Last and it's still stuck at the previous value when it was working; about 20 previous records ago. What a nightmare.

Does anyone know what I might be doing wrong? is it just an Access thing? and is there another way?

Thanks for any help.
 
Simple Software Solutions

Last is looking for the final record found in the list this may not be the last one in the query. I would suggest you look at sorting the data on a field that will determine the last item.
 
Last always causes problems, the best way to find the latest of anything is to date it and look for Max date.

Brian
 
Last (and First) when applied to a table does have issues. That's because data in a table has no implicit order. Even when you apply a sort, this only sorts the display of the data, not the data itself. This issue doesn't arise if you use it on a sorted query because the display and the data are the same thing.

Max (and Min) work fine on tables and queries.
 
Last is not affected by sort. Last refers to the Last record entered (chronoligically) into the database of the group you are selecting.

Brian
 
Thank you Pat, I learn something each time I read your posts, could you please rewrite ACCESS help for us mere mortals. :D

Brian
 
Sorry for not getting back to you all til now and thank you for the responses which has been a good help.

I could have chose Max and done something with that but in the end I used a text box on the form, and had it show an underlying query with Desc order on the bound auto PK and showing the relevant field. text box's only wide enough to show the last record entered anyway.

Sounds amature but what works works I guess. :)
 

Users who are viewing this thread

Back
Top Bottom