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

How to search a character or word by vba

P: 4
Hi All,
Anyone can give me vba code for searching texts in ms access form or recordset. The purpose must be same as search column which is showing access form navigation bar. Becauase I need hide navigation bar and to use our own code.

Sep 21 '12 #1
Share this Question
Share on Google+
4 Replies

Seth Schrock
Expert 2.5K+
P: 2,931
A simple solution would be to but a button on the form and use the control wizard to make the button bring up the search form. In the Record Navigation category, select the Find Record Action. You can finish going through the wizard putting in your own choices. Clicking on this button will bring up the Find/Replace default window. This is the same window that would come up if you click Find in the ribbon bar in Access 2007/2010 or the Edit>Find in previous versions.
Sep 21 '12 #2

P: 4
Hi Seth,
Thanks for your reply. Let me clear what i need actual. I have a bound form with many fileds (such as first name, last name, company, job)
I have two controls on this form. One is a unbound textfield named as txtSearch and another one is a command button named as btnSearch. When we are putting a word in the 'txtSearch' and pressing 'btnSearch', it has to search for the txtSearch value in first field of the first record. When we will make another press on btnSearch button without any changes in txtSearch field, this time it has go to next field of the same record. When all field will finish then it has to go to next record and has to repeat the same. This we can do with the search filed of navigation bar on a accfess form. The same I need in vba code without showing any dialog window such as find/replace.
Sep 21 '12 #3

Seth Schrock
Expert 2.5K+
P: 2,931
How do you want to display the results? Are you looking for a complete list of records or do you just want it to stop at the first one it finds and if it isn't the one you wanted, you click search again and it finds the next?
Sep 21 '12 #4

Expert Mod 5K+
P: 5,287
Zalfa Arif,
Why do you need to replicate what is already available from the software?
What code have you tried so far? Please post it, remember to format your code using the <CODE/> format button.
Sep 21 '12 #5

Post your reply

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