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

Here is a simple search box

P: 556
i have asked this before 'how to make a search box to find a customer without scrolling through the records!" now i have made one so i hope there are people out there who can use this.

Expand|Select|Wrap|Line Numbers
  1. Private Sub Text63_AfterUpdate()
  3.      Dim mydata As String
  6.      If mydata = "" Or IsNull(mydata) Then Exit Sub
  7.      DoCmd.GoToControl "customername"  ' OR WHAT ARE YOU SEARCHING FOR
  8.      DoCmd.FindRecord mydata, acAnywhere, False, acSearchAll, , acCurrent, True
  9. End Sub
i used in this example a textbox but you can use a input box for this as well.
this searchbox example you just have to enter the first two or three letters of the customer and press enter.

this should be on your customer form.
by the way if you have account number to search for you can put that in the code as well just change the:

Expand|Select|Wrap|Line Numbers
  1. docmd.gotocontrol  "accountnumber"
or what ever you searching for.

please let me know how it works.

thanks lee123
Sep 5 '07 #1
Share this Question
Share on Google+
1 Reply

P: 18
Hi lee123,

Great Job. Its working perfectly. Looking for some more useful VBA coding.

Thanks and regards
Sep 5 '07 #2

Post your reply

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