Dim num, t, i, strTag Dim objCtr If Len(strName) > 0 Then Set objCtr = Me.Controls(strName) Else Set objCtr = Me.ActiveControl End If strTag = objCtr.Tag '控件对应的子窗体 For i = 0 To 17 '在子窗中显示数字 Me.Controls(strTag).Form.Controls("Text" & i).Value = "" Next
Dim num, t, i, strTag
Dim objCtr
If Len(strName) > 0 Then 'strName中字数大于,也就是不为空,则为真,否则为假
Set objCtr = Me.Controls(strName) '自定义对象等于指定窗体控件
Else
Set objCtr = Me.ActiveControl '否则自定义对象等于当前控件
End If
strTag = objCtr.Tag '控件对应的子窗体 ,strTag变理为子窗体标签
For i = 0 To 17 '在子窗中显示数字 ,0到17进行循环赋值,清空窗体中子窗体中所有文本控件值
Me.Controls(strTag).Form.Controls("Text" & i).Value = ""
Next
月语老弟,单就这些代码来看,怕理解不一定很全面,我只能试着理解注释一下,也不知道能否对你有否帮助.