Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Listbox ListCount

3 views
Skip to first unread message

SF

unread,
Feb 15, 2009, 9:16:39 PM2/15/09
to
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


Tom Wickerath

unread,
Feb 15, 2009, 9:27:10 PM2/15/09
to
Hi SF,

Try =([List4].[ListCount] - 1)

if you want to display the column heads.


Tom Wickerath
Microsoft Access MVP
http://www.accessmvp.com/TWickerath/
http://www.access.qbuilt.com/html/expert_contributors.html
__________________________________________

"SF" wrote:

> 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 Column Head of the listbox on, the textbox result

Allen Browne

unread,
Feb 15, 2009, 9:29:32 PM2/15/09
to
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.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"SF" <x...@yahoo.com> wrote in message
news:%23ioQhx9...@TK2MSFTNGP04.phx.gbl...

0 new messages