I have a dialobox form and there is a code in Query close event of the form. I want this query close in dialogbox to run only if “OK” button in dialogbox is clicked. If Cancel is clicked I want to ignore code in query close event. Is is possible to do without hiding the default OK,Cancel buttons.
Subject: The OK Cancel buttons are default buttons. I do not know how to check which button is clicked
The OK and Cancel buttons in dialogbox show up by default. I do not know how to figure out which button is actually clicked. If I had a button in mainform which opened the dialogbox, I could have checked if dialogbox as cancelled, but I want to run query close even in the dialogbox form itself and based on whether ok button is clicked or cancelled is clicked I want to run specific code in query close event.
Subject: I know dialog box call returns true, false, but my question was how would I run a query close event in the dialogbox form
Hi Carl,I do know how the dialog box runs and I did read the help. I know if you call a dialogbox from a button on a main form, you can check to see if a dialogbox was cancelled, but my question was not that. I was asking if I can run query close event in the dialogbox form based on which button was clicked (OK, CANCEL).
What you will need to do is create your own “OK” and “Cancel” buttons, with the relevant LotusScript behind them to carry out whatever you want to do for each option.
Then at the bottom of the first tab of the button properties in Designer, you need to set the button “Type” to “OK” or “Cancel”, for each button.
You will also need to change your ws.dialogbox options so that you do not display the default OK and Cancel buttons.