Listbox ListCount

S

SF

Hi,

I have a form with a listbox [list4] and a textbox to show number of record
in the listbox. In the Control Source of textbox, I put the following:
=[List4].[ListCount].

The problem is when I turn Colum Head of the listbox on, the textbox result
always show one record extra.

Is there a way to correct this?

SF
 
A

Allen Browne

Try:
=[List4].[ListCount] + [List4].[ColumnHeads]

Explanation:
ColumnHeads is a true/false value.
Access uses -1 for True, and 0 for False.
So the expression adds minus one if column heads is on, or zero if it's off.
 

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

Similar Threads

ListCount being weird 5
bookmark in subform 2
basOrderBy 1
A2002 bug: ListCount problem 3
Refering List 2
search using a listbox 1
Requery Issue 2
Listbox and Textbox 1

Top