Actually this may be done more or less easily and in a pretty elegant manner via OOP.
For example you design a form which represents dialog interface - controls, themes etc. When you write a class which instantiate this form inside itself and make all black job of tuning the form and retrieving the form output. Outside the class everything looks pretty nice and clean - your code instantiates the class object and works with it through properties/methods/events like with some built-in dialog, e.g. Office.FileDialog.
This provides even better functionality than simple getting/returning MsgBox.
Hope this makes a sense.
Yes that's what I want to do, but I haven't found a parameter-passing mechanism that works. Can you please post a tiny example, perhaps emulating the MsgBox popup? I'm looking for how to pass parameters to the form before it becomes visible, halt the calling code's execution path until the user dismisses the form, and then retrieve the form's values.
I've tried using
DoCmd.OpenForm MyForm.Name,,,,,acDialog,OpenArgs:=MyArgs
without real success.
If there is a way to pass in the address of the calling object through OpenArgs then I could have the form read and set the calling object's members, but that doesn't seem possible.