i am running a loop, and within the loop i am checking value of a variable with the recordset field. if the value matches it proceeds ahead, else a new form is displayed to match the name from the list box.

my problem is when the user selects the name from the list box and click on "OK" button, the new form displayed should hide. i wrote the code form.hide on the click event, but it is not working. before hiding the form, the process of the main form is executed.

pls guide me how to hide the form.

one more problem. while processing, i want a cancel button on my form, clicking which the process should be terminated.

pls guide.

regards,
prakash