Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming a subform like a message box.

Status
Not open for further replies.

buzzboychicago

Programmer
Sep 20, 2004
34
Okay, I know it might be complicated. But how would one go about making a form behave like a message box?

For instance...

If I have a close button on my bound form, and on the click event of close I make a subform popup giving the user checkbox options of "Save and Close" "Cancel Changes and Close" and "Cancel and go back to working on the form"

What do I use (public variables?) to carry the response back to my original form?

This is not the only thing I want to use this for. I just want to know how to make forms and pop-up-forms interact with eachother.

Thanks!!

 
The title shouldn't be subform. Instead it should be Pop-up form.
 
What you should do make a class to hold your data.

If they say save & close, you can make an instance of the class, store the data FROM the form that is already open. Insert the data using a recordset. and close both forms.

If they click cancel and close - then just close both forms.

Another way would be:

If they click save & close do an insert using ADO or DAO with SQL:

Eg:
(ADO)
currentproject.connection.execute "Insert into SomeTable (Fld1, Fld2, Fld3) values (" & form!formname!Value1 & ", " & & form!formname!Value2 & ", " & form!formname!Value3 & ") "

otherwise just close the form.

You'll have to use an UNBOUNDED form for this. If it's an UPDATE you'll have to do UPDATE instead of INSERT.

you get my drift though.



Randall Vollen
National City Bank Corp.
 
I can think of 2 ways you can do it:

1. Use public variables as you suggested.

2. Hide the popup form (rather than closing it) and store the results on the popup form in an invisible field.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top