Select the last record in a listbox

  • Thread starter Thread starter Eric
  • Start date Start date
E

Eric

Hello. I am hoping someone can help me here. I have a form
with a unbound listbox to a table called tblAudit. I have
3 fiends with only two showing. In the table I have
AuditNumber, Plant, AuditDate, and Auditor and in the
listbox I have AuditNumber, AuditDate, and Auditor with
AuditDate and Auditor displayed. What I'm trying to
accomplish is I want to select the most recent AuditNumber
and have it be selected in my listbox. I have tried
everything I can think of to no avail. Can anyone help me?
This is my first time dealing with listboxes and I am
getting a little frustrated as well as intimidated. Thanks
in advance.
 
I believe you can do:

lstTest.Selected(lstTest.ListCount - 1) = True

That would select the last row in any listbox. Assuming that's you're 'most
recent' value...a vaugue term.
 
Back
Top