• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 583
  • Last Modified:

MS Access 2003 on popup form close

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
lrbrister
Asked:
lrbrister
2 Solutions
 
peter57rCommented:
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
 
Dale FyeCommented:
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
 
lrbristerAuthor Commented:
I like both answers
0

Featured Post

Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

Tackle projects and never again get stuck behind a technical roadblock.
Join Now