Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Show last record for multiple (same ) item

Status
Not open for further replies.

401R

Programmer
Oct 31, 2001
23
US
Lets say we have a part which is tracked through several steps. so the table has records with the same part number, but different entry IDs. When I create the form it displays all the entried for that part number, I just need it to display the last record for it.
The records are already in ascending order by a query.

thanks

 
Use the wherecondition, and set it to an SQL statement like "Partnumber = PartNumber AND EntryID = LastEntry"

partnumber being the part you are looking for and last entry being the entryid of the record you want.
 
got it.
Now how can I use that if I have several parts in the table but still many entries per part and I still want the last entry for each part.

Sorry I should have mentioned it before.

Just to be sure, LastEntry is the command I use, not the last entry value. I have never seen it before.

Thanks
 
Use the FindLast method, lastentry isn't a command.

this code should work to find the last entry in the table which has the partnumber you are looking for.

me.recordset.findlast "PartNumber = " & PartNumber

you will need to change "PartNumber" to the proper names for your field and variable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top