Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Simple search function in access?

Posted on 2008-11-18
Medium Priority
Last Modified: 2013-11-28
Hi, I have a form that has boxid and boxbarcode text boxes. When i use the controls at the bottom it scrolls through the records correctly. What I'm looking for is to lock the boxbarcode box and have the boxid box open so you can search for any string of letters and hit a button and it will fill in the corresponding barcode to that box in the boxbarcode box if the search string is correct. Sorry for the repeated use of the word box, I hope that made some sense!
Question by:Mrdogkick
  • 3
  • 2
LVL 77

Expert Comment

ID: 22984090
You cannot use the same control for data entry and for searching for records in the form.
If you want to search then you must have separate controls - in the form header say.

You can use an unbound form and do the search, or you can lookup corresponding values during data entry (of new records or to modify records)  

Author Comment

ID: 22984126
Sorry, I really didn't understand any of that! Please could you elaborate?
LVL 77

Expert Comment

ID: 22984720
If your form is a data entry form, where you normally save records into a table or you are viewing records in the form, you cannot use the same boxes (controls) to search for records.

You have to use different controls (boxes) to enter your search values and then run some code to find the
record(s) that match your search values.

Author Comment

ID: 22984737
ok, so could you let me know how to do that or if you know of an easy-to-follow example...
LVL 77

Accepted Solution

peter57r earned 2000 total points
ID: 22985255
If you are trying to find the record that matches the id you enter, then add a combo box to the form header.
If you use the wizard to do that, and choose the option to 'find a record in my form' it will all be done for you.


Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Beware when using the ListIndex and the Column() properties of a listbox in Access 2007.  A bug has been identified in the Access 2007 listbox code which can cause the .ListIndex property to return a -1, and the .Columns(#) property to return a NULL…
A quick solution showing how to control and open a POS Cash Register Drawer using VBA with MS Access.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
Suggested Courses

571 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question