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

Adding Filter

P: 1
If any one can help me please
i am trying to add a fliter to a search in a form.
the form is used this way

the user inters a project number then the seach will conduct the search using the code below, which works fine.
i need to add a filter so the users can only see and brows through the project number they have entered in txt search which can be multiple records with the same project number.

thanks


ProjectNumber.SetFocus
ProjectRef = ProjectNumber.Text
txtSearch.SetFocus
strSearch = txtSearch.Text

'If matching record found sets focus in ProjectNumber and shows msgbox
'and clears search control

If ProjectRef = strSearch Then
MsgBox "Match Found For: " & strSearch, , "Congratulations!"
ProjectNumber.SetFocus
txtSearch = ""
Oct 5 '06 #1
Share this Question
Share on Google+
1 Reply


PEB
Expert 100+
P: 1,418
PEB
In fact you can do the search in your form in assigning the SQL condition to filter property in the form...

Or directly to the recordsource property modifing entierly your SQL behind your form!

Like:

Me.Filter ="Myfield='dfdfd'"

:)

Best regards!
Oct 8 '06 #2

Post your reply

Sign in to post your reply or Sign up for a free account.