Count of records in Listbox

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have an bounded Listbox of one column filled with a rowSource query with a
WHERE clause.

Is there a property or method than I can use to determine how many records
have be loaded into the listbox?

Thanks for your help.
 
Lee,

What you need is something like:

Me.MyListBox.ListCount

in the form's own module, or

Forms("MyForm").Controls("MyListBox").ListCount

in another module.

HTH,
Nikos
 
Thanks, Van.

That proved that my requery did not work. Can you suggest a reason why?

qryStr = "SELECT Master.Part FROM Master ORDER BY Master.Part"
Me.Part.RowSource = qryStr
Me.Part.Requery
 
qryStr = "SELECT Master.Part FROM Master ORDER BY Master.Part"

Is Master a reserved word? You might try using a more specific name, or
hiding it in square brackets.

qryStr = "SELECT Part FROM HeadTeachers ORDER BY Part"

qryStr = "SELECT [Part] FROM [Master] ORDER BY [Part];"

What happens when you try this query in the query designer? Are there any
non-null records?

HTH


Tim F
 
Back
Top