I'd always expect OK to close a form with confirmation, not cause a dialog. Special case may the question "Are you sure?" to confirm something, but that aside, in the first place you need
first form Botton click event code:
And you've con 99% of what you need.
As you can do anything in a form, no matter if it's started from a menu item or by click of a button, you can also ask or allow the user to enter anything you want and store it where you need it.
So what else do you actually need? It would still help if you can think of a more concrete case. I think the core problem isn't calling a form, is it? It's getting the input returned.
In the simplest case of a modal secondform you call it by
Code:
DO FORM secondform TO resultvariable
And in secondform.scx have a RETURN in its unload event:
You might want to return what a user picks in a combobox, the only hurdle left for something like that is that Unload event happens after form controls have been removed, so you can't for example RETURN Thisform.Text1.value but in the OK button of secondform you could do:
Code:
Thisform.result = thisform.text2.value && or anything else
Thisform.Release()
Where result is a property of the form you have to add in the form designer. You could also use the Tag property as a simple solution, just be aware you can only assign strings to it, and thus, for example, not return a number (which might be plausible in case you ask for number of copies of a report to print) or a date (which might be plausible if the secondform.scx is a date picker form).
To give you an idea why you don't need Unload to return anything, you could let secondform use controls bound to a dbf like secondform.dbf, that could have multiple fields and also multiple records and then you can just use the first advice - DO secondform.scx - and then get whatever was entered in secondform by reading from secondform.dbf.
And for that matter, it could be anything, any dbf you already have and let secondform.scx work on, just like any other normal unrelated form that works on its own and doesn't return something. Which - in short - means, you can do whatever you want.
And that brings me back to the question why you're asking, you have to have something more specific in mind that you can't do with all you already know and do. What I said already before is, that what you aks needs no special additional knowledge, you don't depend on knowing the return mechanism of a form. And as you already programmed forms that have input controls and store inputs somewhere, you already have all necessary ingredients. This is what makes me and I guess also Mike Lewis think, what really is your problem, you know how to start a form and store what a user enters, you now just DO someform in a click of a form commandbutton instead of a menu item.
The second form could indeed have further buttons starting third forms.
Chriss