Selecting listbox items programmatically by using stored parameter

G

Guest

Hi.

My application needs to be able to recall reports defined and saved by the
user (so he doesn't have to go back to the form and make selections all over
again). The save module works fine. However, when I try to select listbox
items based on those selected by the user, I get an error (and no items get
selected). Here's the relevant code, the purpose of which is to take the
value in the activecell, find it in the listbox and select it in the listbox.

For j = 0 To frmGraphingCenter.lbxSummaryMeasure.ListCount - 1
For k = 0 To TitleRec - 1
If ActiveCell.Offset(k, 0).Value <> Empty Then
If ActiveCell.Offset(k, 0).Value =
frmGraphingCenter.lbxSummaryMeasure.List(j) Then
frmGraphingCenter.lbxSummaryMeasure.List(j).Selected = True
End If
End If
Next
Next

Line six causes the 'Object Required' error. Any ideas?

Thanks!
 

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