N/APosted on - 09/22/2012
I have created a database about product data using MS Access. I have this column where it shows the status of the product whether it is new, refurbished or repaired with ID Name called “Prod_Stat”. Now, what I would like to happen is to enable a find function in form access where the user can use a search feature.
By using a specific “Prod_Stat” value, the user will be taken to that record on a form I have stumbled upon this Search Code but it appears to be not of help.
How to enable find function in form access?
Use the Control Wizards to add a command button that runs the search function:
On the Controls toolbar, at the beginning of it, turn-on the 'Control Wizards.'
Select 'Command Button' and place it on your form. The Control Wizard will start. In the Categories list, select 'Record Navigation,' and in the Actions list, select 'Find Record.' Finish configuring the button.
The wizard add this code to the On Click event of the button:
Screen .Previous Control. Set Focus
DoCmd. DoMenuItem ac Form Bar, acEditMenu, 10, , acMenuVer70
You can use this search button on any field in your form – just put the cursor in the textbox that you wish to search and press the button. There are several settings on the search applet that you can use to refine your search.
Read in the Help System about 'wildcards' like the asterisk character that represents any number of any characters, like "Smith, J*"
If you wish to search only the name field, you can put code at the beginning of the OnClick event for the button (the code above) that will move the cursor to the name field before running the search code: