thechazm
VBA, VB.net, C#, Java
- Local time
- , 22:18
- Joined
- Mar 7, 2011
- Messages
- 515
Here is a module I developed to search all fields in any form and then snaps the form to that record. Allowing you to have advanced searching abilities without having to depend on the small search bar at the bottom of the form.
All you have to do is import the module. Then in any form create a text box for your search box. You can either run the code in the on_Changed event of the text box making it work character by character or just simply add the command to a search button that uses the text box for the criteria.
Here's how it works:
Searchall "The form name goes here", "Any value you want to search for here"
And that is it!
So an actual example of this would be something like this:
Searchall me.name, me.txtSearch.value
Now thats easy. I have also customized the function to work with forms that run off of sql queries instead of just directly to the table.
If there are any problems let me know and we can update the code but I tested it under every scenario I could think of.
If this code helps you then let others know and where to get it. Happy Developing
Here is the attached file that contains the module.
View attachment Search.zip
All you have to do is import the module. Then in any form create a text box for your search box. You can either run the code in the on_Changed event of the text box making it work character by character or just simply add the command to a search button that uses the text box for the criteria.
Here's how it works:
Searchall "The form name goes here", "Any value you want to search for here"
And that is it!
So an actual example of this would be something like this:
Searchall me.name, me.txtSearch.value
Now thats easy. I have also customized the function to work with forms that run off of sql queries instead of just directly to the table.
If there are any problems let me know and we can update the code but I tested it under every scenario I could think of.
If this code helps you then let others know and where to get it. Happy Developing
Here is the attached file that contains the module.
View attachment Search.zip