Solved

MS Access 2003 on popup form close

Posted on 2013-01-21
3
573 Views
Last Modified: 2013-01-22
I have a process that is opening a popup form.

The popup form runs one of several processes

I would like to return the results to the original form so I can access and run seperate processes.

This is launching the popup form and currently work fine...I just need access to the results.

Private Sub cmdEMailDepartments_Click()
    DoCmd.OpenForm "EmailForm", WindowMode:=acDialog, OpenArgs:=0 & "|" & "" & "|" & "1"
    MsgBox "Done", vbOKOnly, "Process Done"
End Sub
0
Comment
Question by:lrbrister
3 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 250 total points
ID: 38802274
Do you have controls on the original form where the results can be placed?

If so then in your code that calculates the results you just do...

Forms!originalformname!controlname = <this result>
0
 
LVL 47

Assisted Solution

by:Dale Fye (Access MVP)
Dale Fye (Access MVP) earned 250 total points
ID: 38803360
Peter provided the method to Push the results from the popup to the calling form.

If you want to pull the results, instead of closing the popup, set it's visible property to False when the user is done with that form.  This will allow the code in the calling form to proceed.  Then modify the code of the calling form:

    DoCmd.OpenForm "EmailForm", WindowMode:=acDialog, OpenArgs:=0 & "|" & "" & "|" & "1"
    varVariableName = Forms!popupName.ctrlName
    docmd.close acform, forms("popupName")
    MsgBox "Done", vbOKOnly, "Process Done"

The key to this method is understanding that when a form is opened using the acDialog windowMode, then the code that follows that line will not be processed until the form is close OR (and this is a big or) that form is hidden.
0
 

Author Closing Comment

by:lrbrister
ID: 38805350
I like both answers
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The canonical version of this article is on my web site here: http://iconoun.com/articles/collisions/ A companion presentation is available here: http://iconoun.com/articles/collisions/Unicode_Presentation.pdf
Many companies are making the switch from Microsoft to Google Apps (https://www.google.com/work/apps/business/). Use this article to learn more about what Google Apps has to offer and to help if you’re planning on migrating to Google Apps. It is …
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…

929 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now