Solved

MS Access 2003 on popup form close

Posted on 2013-01-21
3
575 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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Having trouble getting your hands on Dynamics 365 Field Service or Project Service trial? Worry No More!!!
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

776 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