Solved

MS Access 2003 on popup form close

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Deploying a Microsoft Access application in a Citrix environment is not difficult but takes a few steps. However, Citrix system people are often of little help, as they typically know next to nothing about Access. The script provided here will take …
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
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…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.

757 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

18 Experts available now in Live!

Get 1:1 Help Now