List Box error shows up.

  • Thread starter Thread starter Frank Martin
  • Start date Start date
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
 
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.
 
Back
Top