List Box error shows up.

F

Frank Martin

I have Access2000 with WindowsXP.

I have a list box on my form set to the property of "None",

And this works fine.

I want to set it to "Simple" so that I can see all the selections I make,
but when I do this I get an error "Run time error 94 - Invalid use of null"

The block of code displayed by the error message is:

*******
Private Sub List6_AfterUpdate()
' Find the record that matches the control.
Dim rs As Object
Set rs = Me.Recordset.Clone
rs.FindFirst "[AddressesID] = " & Str(Me![List6])
Me.Bookmark = rs.Bookmark
End Sub

********
Is there anyway around this problem?

Please help, Frank
 
W

Wayne Morgan

The problem is that when you set the listbox to "multiselect" (simple or
extended) it no longer has a "value". You have to use the ItemsSelected and
ItemData properties of the listbox to get the selected rows.
 

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