By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,965 Members | 1,170 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,965 IT Pros & Developers. It's quick & easy.

How to add a filter in Acess in VB

P: n/a
How do I add a filter in VB?
is this enough: DoCmd.ApplyFilter , "LastName = 'King'" or I
need something before this which would say in which table or query?
And how do i close the filter,how do i remove it?

Danijela

Nov 13 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
da****************@gmail.com wrote:
How do I add a filter in VB?
is this enough: DoCmd.ApplyFilter , "LastName = 'King'" or I
need something before this which would say in which table or query?
And how do i close the filter,how do i remove it?

Danijela

For a form, I like Filter And FilterOn
Sub SetFilter(strFilter As String)
Me.Filter = strFilter
Me.FilterOn = (strFilter > "")
End Sub

You could pass this to set a filter to display records with ID = 123
SetFilter "ID = 123"

And to clear a filter
SetFilter ""
Nov 13 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.