List box not showing all records

K

Kevin

When I open a form and select a record from a list box, I
can not scroll to last record in the query. If I open a
form and scroll to the bottom of the list before I make a
selection all records will be available.
Does anyone know how to make all records available
without having to scroll first?
 
K

Ken Snell

You can "force" the listbox to load all records in the form's OnOpen event:

Private Sub Form_Open(Cancel As Integer)
Dim lngCBOCount As Long
On Error Resume Next
' Initialize the listbox's records
lngCBOCount = Me.ListBoxName.ListCount
End Sub
 

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