在子窗体重定义一个Private变量和一个public过程用来传递参数。Private m_nID as long Public Sub SetID(byval nID as long) m_nID = nID End SubSub Form_Load() ' you can use the m_nID here End Sub'''''''''''''''''''''''''''''''''''''''''''''''''' ' Parent Form calling sub code fragment '''''''''''''''''''''''''''''''''''''''''''''' ' .............. Dim frm As new frmChild frm.SetID( .... ) frm.Show .........
load的时候调用模块
Public Sub SetID(byval nID as long)
m_nID = nID
End SubSub Form_Load()
' you can use the m_nID here
End Sub''''''''''''''''''''''''''''''''''''''''''''''''''
' Parent Form calling sub code fragment
''''''''''''''''''''''''''''''''''''''''''''''
' ..............
Dim frm As new frmChild frm.SetID( .... )
frm.Show .........