Help: Pass argument from Child window to Parent window?

galantis

Registered User.
Local time
Today, 07:03
Joined
Feb 10, 2005
Messages
32
Hi,

I have a parent window which upon clicking on a button will pop-up a child window containing a listbox. The listbox recordsource is a subset of the parent window. I want the user to select a record from the listbox which will load the selected record onto the parent window.

How does one pass argument back from child window to parent window?

From parent window to child window, I used
docmd.openform ,,,,,,[argument] and me.openargs in the child window

thanks in advance.
 
thanks for your answer, but which window events of the parent window do I trap this when it has passed back?

It is not OnOpen or OnLoad because the parent window is already open and loaded, docmd.open will just brings the parent window to the front.
 
you don't need to trap anything, it's irrelevant whether theparent window is open

Private Sub lstFound_DblClick(Cancel As Integer)
On Error GoTo Err_lstFound_DblClick

Dim strFormName As String

strFormName = "YourForm"

DoCmd.OpenForm strFormName, , , "[YourKeyID] = " & Me!lstFound

DoCmd.Close acForm, Me.Name

Exit_lstFound_DblClick:
Exit Sub

Err_lstFound_DblClick:
MsgBox Err.Description
Resume Exit_lstFound_DblClick

End Sub
 
thanks for the help Rich,

finally got it working, I used me.openargs to trap the argument being passed in.
 

Users who are viewing this thread

Back
Top Bottom