Link to home
Start Free TrialLog in
Avatar of German Mikulski
German Mikulski

asked on

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!
ASKER CERTIFIED SOLUTION
Avatar of JS List
JS List
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of PatHartman
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.