这里有一个模式,假设子窗体是模态的。
以你父母的形式
Private Sub cmdOpenChild_Click()
DoCmd.OpenForm "ChildDialog", acNormal, , , , acDialog, "Info for child"
'This line will block further code execution until child form is hidden or closed.
MsgBox Forms.Item("ChildDialog").Controls.Item("SomePropertyOrControl").Value
DoCmd.Close acForm, "ChildDialog"
end sub
以儿童形式
有一个关闭按钮,实际上只隐藏窗体。
Private Sub cmdClose_Click()
'hide the form instead of closing it to return control to caller.
Me.Visible = False
End sub