I am using this code to popolate an Access Form. When i try to use the filter command, (from toolbar) , the filter doesn't works. I got an error ....about data provider initializer.

Any kind of sort command i working well instead.

Can anyone give me a suggestion about this trouble?

Private Sub Form_Open(Cancel As Integer)
Dim cn As ADODB.connection
Dim rs As ADODB.recordset


Set cn = CurrentProject.AccessConnection
Set rs = New ADODB.recordset
With rs
Set .ActiveConnection = cn
.Source = "SELECT * FROM tabella1"
.LockType = adLockOptimistic


.CursorType = adOpenStatic
.Open
End With
Set Me.recordset = rs
Set rs = Nothing
Set cn = Nothing
End Sub


sorry about my english.