Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

MS Access 2003 on popup form close

Posted on 2013-01-21
3
Medium Priority
?
581 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 77

Accepted Solution

by:
peter57r earned 1000 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 48

Assisted Solution

by:Dale Fye
Dale Fye earned 1000 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

Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Explore the ways to Unlock VBA Project Password Excel 2010 & 2013 documents. Go through the article and perform the steps carefully to remove VBA Excel .xls file.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

636 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