Saturday, 16 January 2010

Free download:Student Search on Database

Student Search on Database
Searching for a record based on a text box value in a form:
There are times, when developing your Microsoft Access databases, that you may wish to allow your users to search for a record in the form that contains a certain value which will be entered into a textbox.
Below shows the example Microsoft Access form containing an unbound text box and command button (Search) which will enable the user to enter a value to be searched on.
Form containing the text search facility
Form containing the unbound text search facility.
To perform the search you will need to enter a value (this search is based on the student number primary key) into the unbound text.
The code below is attached to the command button - cmdSearch. This code checks for a value (if no value is entered or no match found it will then return one message and set the focus back to the search field.
If a value is found it will return the appropriate record and will give a message then clear the search control.


  1. First click the command button on the form(without typing any value into the search field) and you will be told to enter a value.
    Error message when no search value is entered.
    Error message when no search value is entered.



  2. Next try entering a value of XXXXXXX. The message will advise that no student found with this value.
    Error message when an invalid search value is entered.
    Error message when an invalid search value is entered.



  3. Finally type in DD27676. This will return a match and take you to the corresponding record.
    Message when matching search value is found.
    Message when matching search value is found


for more information and support





No comments:

Popular Posts