Unable to select last record in multi column listbox

V

Vinod

Hi All,

Please helpme out from the following issue.

I've designed a from with multi list box. While opening I've been passing a
query as row source to the list box and doing requery.

I opened form by double clicking and initially listbox displayed with 7
records which is correct and I'm unable to select last record in the list
where as rest of the recordsd I'm able to select.

In the list box on click event I put a message box which is firing when any
record is selected but this message is not presented for last record since it
is not allowing to select.

I tried like this.
Opened the same form in design view, from there I clicked on 'Form View'
there I'm able to selecte all records including last record and a message box
is displayed for last record also since it is selected.

Can anyone helpmeout by sharing your thoughts and ideas in resoloving the
above said issue.

Advanced Thanks,
Vinod.
 
K

Ken Snell \(MVP\)

How are you doing the select? If you're using ItemData (or other property),
that is a zero-based property, so the last column line in a list box would
be ItemData(NumberOfLines - 1). Example: if the list box contains 7 lines,
you'd refer to the last line as the 6th one.
 
V

Vinod

Thanks Ken Snell for your response.

I'm selecting using mouse pointer and I'm initializing the list box with
lst.Rowsource=query and then performing lst.requery.

The above action is taking place at the time of form open.

Hope you got my point. Please provide the solution if you can.

Once again thanks.

Regards
Vins
 
H

Howard Burgman

Vinod said:
Hi All,

Please helpme out from the following issue.

I've designed a from with multi list box. While opening I've been passing
a
query as row source to the list box and doing requery.

I opened form by double clicking and initially listbox displayed with 7
records which is correct and I'm unable to select last record in the list
where as rest of the recordsd I'm able to select.

In the list box on click event I put a message box which is firing when
any
record is selected but this message is not presented for last record since
it
is not allowing to select.

I tried like this.
Opened the same form in design view, from there I clicked on 'Form View'
there I'm able to selecte all records including last record and a message
box
is displayed for last record also since it is selected.

Can anyone helpmeout by sharing your thoughts and ideas in resoloving the
above said issue.

Advanced Thanks,
Vinod.
 

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