Search all fields in any form extreamely fast with hardly no effort

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
 
Set it up and it gives a type mismatch error when you type in the textbox. Any thoughts?
 
You lost me after creating the text box in the form.

Imported Search o.k then created the text box then what?

Shame as I think it would be the best thing since the invention of Computers!

Hope you have the time to help a newbie!
 
Have not been able to make it work. My form name is Bookings, the criteria I am unsure of the syntax. Can you please help me with this?

Regards

Guy MacDonald
 

Users who are viewing this thread

Back
Top Bottom