Public Sub SetParentFormctrls(ByVal frm As Form) '功能:将子窗体控件数据赋值给主窗体对应控件 Dim ctrls As Controls Dim Ctrl As Control On Error Resume Next Set ctrls = frm.Parent.Controls For Each Ctrl In frm.Controls If Ctrl.ControlType <> acLabel Then ctrls(Ctrl.Name).Value = Ctrl.Value End If Next End Sub