473,387 Members | 1,575 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

How to display most recent record?

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
7 5844
NeoPa
32,556 Expert Mod 16PB
You have posted this in the Access Articles section.

I am moving it to the Access forum.

MODERATOR.
May 20 '07 #2
Sorry about that....
May 20 '07 #3
NeoPa
32,556 Expert Mod 16PB
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
32,556 Expert Mod 16PB
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
3,080 Expert 2GB
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
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
32,556 Expert Mod 16PB
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

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

Similar topics

7
by: Nova's Taylor | last post by:
Hi folks, I am a newbie to Python and am hoping that someone can get me started on a log parser that I am trying to write. The log is an ASCII file that contains a process identifier (PID),...
2
by: Shaiguy | last post by:
I have a table containing the following fields: ProjectUpdateID (PrimaryKey) ProjectID UpdateDate I would like to create a Query in Ms Access 2000 which will return me the most recent 2...
3
by: DataBard007 | last post by:
My Access 97 database has a form that contains text boxes that display people's names, addresses, phone numbers, etc. The record source is a single table. I created a NextRecord and Previous...
10
by: perryche | last post by:
Experts, I have the following scenario: Table1: RecordID RecordDate ... I want in a query to show me within this RecordID, only the latest RecordDate and info. I know I can use the Max...
3
by: den 2005 | last post by:
Hi everyone, Here is code working on..Trying to insert record with a column with Image or VarBinary datatype in sql database from a existing jpeg image file, then retrieve this image from...
3
by: ApexData | last post by:
I am using a continuous form for display purposes. Above this form, a single record is displayed so that when the user presses my NewButton they can enter a NewRecord which gets added to the...
3
by: maylee21 | last post by:
hi, anyone can help me figure out how to read data from a text file like this: 10980012907200228082002 and extract the data according to this kind of format: Record type 1 TY-RECORD ...
36
by: beebelbrox | last post by:
Hi, I am new VB programming in Access and I am requesting help with the following code. WIndows OS MSaccess 2003 This code is attached to an unbound form that will display a specific recordset...
13
by: angi35 | last post by:
Hi - working in Access 2000... my goal is to combine fields from two tables in a query: Table 1 has ItemNumber and ItemDescription. There's only one record per ItemNumber. Table 2 has ItemAlias....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.