By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,062 Members | 1,358 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,062 IT Pros & Developers. It's quick & easy.

How to display most recent record?

P: 5
I use a form to enter data into a table. The user then has the opportunity to recall the data in the form based on a search to review and update the info. For example, on my menu there is a combo box where the name is selected. Once the name is selected my code recalls the form with the previously entered data.

The problem I have now is that when the same name is used for a new trip (same person, new trip) my form displays the data that was entered for the very first trip. I can use the next record button at the bottom, but this seems to create some confusion for others....

Is there a way to display the most recent record first?
May 20 '07 #1
Share this Question
Share on Google+
7 Replies


NeoPa
Expert Mod 15k+
P: 31,494
You have posted this in the Access Articles section.

I am moving it to the Access forum.

MODERATOR.
May 20 '07 #2

P: 5
Sorry about that....
May 20 '07 #3

NeoPa
Expert Mod 15k+
P: 31,494
I use a form to enter data into a table. The user then has the opportunity to recall the data in the form based on a search to review and update the info. For example, on my menu there is a combo box where the name is selected. Once the name is selected my code recalls the form with the previously entered data.

The problem I have now is that when the same name is used for a new trip (same person, new trip) my form displays the data that was entered for the very first trip. I can use the next record button at the bottom, but this seems to create some confusion for others....

Is there a way to display the most recent record first?
You need to go away and think about how the data is stored in your table(s).
Have a look in Normalisation and Table structures.
May 20 '07 #4

NeoPa
Expert Mod 15k+
P: 31,494
Your job will be much easier if the field(s) you search on are unique. If time is a factor then you need to store the time in the record to search on.
May 20 '07 #5

nico5038
Expert 2.5K+
P: 3,072
And to add to that, when there's no unique identifier, just add an autonumber field as the unique key.
When processing the data use a descending sort order so the most recent entered record will show on top.
Personally I always show the users the data in a datasheet subform and have the descending order established in the query to fill the form.

Nic;o)
May 20 '07 #6

P: 5
Thanks for the comments. I actually found the Orderby command and was able to have the date of the most recent entry appear first by placing orderby DESC in the VB code.
May 21 '07 #7

NeoPa
Expert Mod 15k+
P: 31,494
I presume you had a Date/Time field in there for that to work on then.
That would be a good way to handle it in that case :)
Well done.
May 23 '07 #8

Post your reply

Sign in to post your reply or Sign up for a free account.