Search after click the Button [John Big Booty's Sample DB]

rocky09

Registered User.
Local time
Today, 15:48
Joined
Nov 21, 2012
Messages
51
Hello All,

Good day,

Thank you very much John for your awesome VBA Code.

I have been using John Big Booty Script, which he provided here.

Code:
[w w w dot]access-programmers[dot]co[dot]uk/forums/showthread.php?t=188663

Please replace[w w w with www] and [dot] with .


Now, I am trying to put a Button to search. So, when I enter the value and click then only it should search. In other words, instead of Dynamic Search I want the code able to search the data after Click on the Button.

Is there any way to do it.

Please let me know, if I am not clear about my request.

Thank you so much in advance.

Best Regards,
Rocky
 
Generally speaking, take the code out of the change event and put it behind your button, and drop the .Text from any references to the search textbox.
 
Generally speaking, take the code out of the change event and put it behind your button, and drop the .Text from any references to the search textbox.

Hi Paul,

Thank you so much for your quick reply. I didn't understand this line.

Code:
 .Text from any references to the search textbox.

can you please advise.

Thank you in advance,
 
From his code this:

vSearchString = SearchFor.Text

would become

vSearchString = SearchFor

The .Text property requires focus, which the textbox won't have once you click on the button. .Value is the default, so if you don't specify a property you get the value. More here if you're interested:

http://www.baldyweb.com/ValueText.htm
 
From his code this:

vSearchString = SearchFor.Text

would become

vSearchString = SearchFor

The .Text property requires focus, which the textbox won't have once you click on the button. .Value is the default, so if you don't specify a property you get the value. More here if you're interested:

Hi Paul,

Thank you so much for your reply. Now I am getting the following error at this point.

Code:
me.searchresults.requery
Compile error:
Method or data member not found


Can you please help me.

Thank you in advance.
 
Is searchresults a listbox or control on your form?
 
Is searchresults a listbox or control on your form?


Hi Paul,

You are the best. Yes. I renamed the list to SearchResults now. It is working.

Thank you so much Paul.

Best Regards,
Rocky
 
Yo Rocky, happy to help. :p
 

Users who are viewing this thread

Back
Top Bottom