We help IT Professionals succeed at work.

Showing last record of a database table on web form

Hello,

I am creating a web application based on vb.net
I would like to show the last added record to an access database table, on one of my forms.
How can I do it? I have tried using formview tool, but did not work out how to make it show the last added record.

Thanks a lot!
Comment
Watch Question

Commented:
Do you know how to make a connection and pull records from the database table?

If yes then you would do it with the query.  
Ex:  "Select MAX(id), field1, field2, field3, From tableX  Group By field1, field2, field3"
Distinguished Expert 2017

Commented:
Jshesek's solution is incomplete since you need to select the fields that are in the same record as the max(id).  You can do it with a sub select that finds the max and the outer query selects all the related fields or you can select the set of records you want and sort them descending by ID.  Use the Top 1 predicate to select only the row with the highest autonumber value.