Buttons of type OK or Cancel only work once

I have placed buttons of type OK and Cancel on a subform in a dialog box.everything worked fine until I added code in queryclose to check validity of certian fields.

when the fields are not valid i exit queryclose with "continue = false and place the user on the invalid field.

from this point on the butons of type OK and Cancel cease to function.

Any ideas?

Subject: RE: Buttons of type OK or Cancel only work once

Hi Eli,try to use @Formula in the Input validation fields. This should work. The QueryClose event seems to clash with the Dialogbox handler.

Hth

:slight_smile: stw

Subject: RE: Buttons of type OK or Cancel only work once

Thanks - Stephan but -There are quite a few fields on the dialog box subform and i want to check which ones were not filled out and give an appropriate message based on which were not filled.

That’s why i coded queryclose where i can check the whole form at once.

Again what is really strange is that the OK or Cancel button works fine the first time. I enter queryclose and do my checks with my appropriate message.

It’s after i stay on the subform that the buttons react like normal buttons and not like OK or Cancel.