Can anyone tell me what this is for? And how to use it? There seems to be no specific help for this on the MSDN cds...
Printable View
Can anyone tell me what this is for? And how to use it? There seems to be no specific help for this on the MSDN cds...
I don't know if you have ever worked with MS Access but if so you should be ashamed.
This filter option you are talking about is an extra SQL-command that is used to limit the number of record listed. In order to do this fast and to remove it fast, microsoft gave us this command.
You can use it with a recordset, but also with a database. When you do it with a database, then all recordsets based on this database-object has the same filter.
When you change the database-filter, all the recordsets that are refreshed then take the new database filter. Enebling you to change a numoures count of recordsets with a single change.
Woah Jeroen!!! I've worked a little with Access, but I feel no shame...
Thing is, I do know what a filter is, and there is sample code in the MSDN, but only using created db objects, not ones drawn on a form. What I was really looking for was how to make this particular filter take effect.
So can you give me some sample code please?
Don't nobody know?
What is it you are trying to filter? Or what is it you want an example of? Be specific.
We'll hook you up.
I just want to know how to apply a filter for a data object. I've tried stuff like 'Data1.Recordset.Filter = ' and all that, but it doesn't seem to affect anything. Is there something I need to do to get the filter to take effect or what? The only filter example in the help system applies to data objects created at runtime.
Ed, I thought you were going to hook me up...
Lets say you have recordset with a FirstName field in the query and you want to limit it to just the first names that start with 'f' then
Lets take the same example and say you want to also take only those with the LastName starting with 'Ma'Code:Data1.recordset.filter="FirstName Like f*"
Or if you want to filter by what a user has typed in a textboxCode:Data1.recordset.filter="FirstName Like f* And LastName Like Ma*"
And to reset the filter back to noneCode:Data1.recordset.filter="Firstname='" & Text1.text & "'"
Sorry about the delay but better late then neverCode:Data1.recordset.filter=""
Thanks mate, it was a long time coming!