How to close underlaying document from dialog box?

I have a formA. When I click the button on FormA a dialog box appears. I fill the dialog box and when I click OK button, I need to close both - dialog box and also a formA.

Any ideas?

  • I did not find any function like doc.Close(unid), or something like that …

Subject: How to close underlaying document from dialog box?

You can’t do it from the dialogbox, but you can do it from the code that CALLS the dialogbox.

Subject: RE: How to close underlaying document from dialog box?

Stan, could you be more specific, or at least can you tell me, what should I look for in the documentation?

Subject: RE: How to close underlaying document from dialog box?

Look at the Designer Help EXAMPLES for the Dialogbox method. They use:

someVariable = ws.Dialogbox(…)

If someVariable Then…

That should be a hint that the code continues to run after the dialogbox is dismissed when the dialog return is assigned to a variable. You can use, oh I don’t know, maybe Call uidoc.Close?

Subject: RE: How to close underlaying document from dialog box?

LOL!

If you are calling your dialog box via formula… you might try adding an @PostedCommand([FileCloseWindow]) at the end of the code in your button. I haven’t tried this but it should work.

Cheers,

Mark