Cancel button ruins program! Please help
Hello,
I'm making a Student Record System and one of the options I currently have is the ability to search through records (in this case students). When selected the user is allowed to enter a desired Surname and Forename to search as shown:
http://www.ingserv.com/help.jpg
This is created by the use of a macro with a where condition on click:
The code, incidently, all works fine the problem I am having is that when the user presses the 'Cancel' button as oppose to 'OK' the program springs up an error and closes my form down as shown:
http://www.ingserv.com/help2.jpg
Does anyone know any VB or an amendment I can make in my where condition to state what I want it to do upon clicking the 'Cancel' button please?
Any help much appreciated!
Thank you.
Hello,
I'm making a Student Record System and one of the options I currently have is the ability to search through records (in this case students). When selected the user is allowed to enter a desired Surname and Forename to search as shown:
http://www.ingserv.com/help.jpg
This is created by the use of a macro with a where condition on click:
Code:
[Surname] Like [Students surname? (Omit for all records)] & "*" And [Forename] Like [Students forename? (Omit for all records)] & "*"
The code, incidently, all works fine the problem I am having is that when the user presses the 'Cancel' button as oppose to 'OK' the program springs up an error and closes my form down as shown:
http://www.ingserv.com/help2.jpg
Does anyone know any VB or an amendment I can make in my where condition to state what I want it to do upon clicking the 'Cancel' button please?
Any help much appreciated!
Thank you.