parameter query opening a form

P

Pitu

I have a button which on clicking runs a macro which opens another form. This
form is a result of a parameter query which brings data to the form according
to the parameter selected. Now if the parameter entered does not have any
record in the underlying table, currently a blank form opens. What i want is
if the parameter entered does not have any record in the table a message box
pops up to the user that you entered a invalid entry and then the blank form
does not show up at all. How to do this.
 
J

Jeff Boyce

Rather than letting the user enter incorrect/invalid choices and be told to
try again, consider making the first form ONLY allow selection of valid
information. Or, you could add a routine into the code you have behind the
button click event. That routine would check for the number of records
matching the criteria, and, if none are found, cancel the click and display
a message.

My preference would be to only allow selection of valid information -- it's
less irritating than being told I did something wrong.

Regards

Jeff Boyce
<Office/Access MVP>
 
Top