code below
Private Sub cboWYSZUKAJ_AfterUpdate()
Dim cn As ADODB.Connection
Dim rs As ADODB.Recordset
Dim strFrmNm As String
Set rs = New ADODB.Recordset
Set cn = New ADODB.Connection
Set cn = CurrentProject.Connection
rs.Open "SELECT * FROM qry99_DANE WHERE NRZLEC = CStr(" & Me!
cboWYSZUKAJ & ");", cn
Set Me.Recordset = rs
rs.Close
cn.Close
Set rs = Nothing
Set cn = Nothing
End Sub
/
Maciej
What's a 7965? As in description? A lot of us haven't memorized the
error number list and their meanings. Regardless...couldn't you do
something like the following instead?
Me.Recordsource = "SELECT * FROM qry99_DANE WHERE NRZLEC = CStr(" &
Me!cboWYSZUKAJ & ");"
Unless you are changing the recordsource for some specific reason, I
might have something like this instead
Dim strF as string
If not isnull(Me.combo1) then
strF = "NRZLEC = """ & CStr(Me!cboWYSZUKAJ) & """"
Endif
msgbox "strF is " & strF 'remove/comment out after debugging
Me.filter = strF
Me.FilterOn = (strF > "")
to filter or remove the filter on the existing recordsource.