Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Filter a recordset

Status
Not open for further replies.

ionutdinulescu

Programmer
Jun 11, 2002
59
GB
I have the following code :
Lista.Recordset.Filter = cbCampuri.Value & _
"='" & _
txtValoare.Value
Lista.Requery

where my Lista is a listbox.
The problem is that this listbox doesn't apply the filter. What else should I write here ?
 
Dynamically rebuild the Lista.RecordSource with a WHERE clause.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ222-2244
 
This is ok for filtering but it gives an "Object invalid or no longer set" error when I try to delete any record with Lista.Recordset.Delete. It's working fine if I don't have a WHERE clause.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top