selecting the last tiem in a listview control

R

Ricky A.

Working with Access xp, how would I select the last item in a list view?

Thanks
 
A

Al Borges

Hi Ricky:

I work with Access 2000, but this should also work with Access XP-

Private Sub Command2_Click()
Dim dbs As Database, rst As Recordset, strSQL As String
Set dbs = CurrentDb
strSQL = "SELECT [ACCOUNTS].[ACCT], [ACCOUNTS].[DATEPOSTED] FROM
[ACCOUNTS];"
Set rst = dbs.OpenRecordset(strSQL)
With rst
.MoveLast
List0.Value = ![ACCT]
.Close
End With
End Sub

Regards,
Al
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top