写个自定义函数即可:
Function B(frm As Form) As Boolean
Dim ctls As Controls
Dim ctl As Control
Set ctls = Me.Controls
B = False
For Each ctl In ctls
If clt.ControlType = acSubform Then
B = True
Exit Function
End If
Next ctl
End Function
调用时:
if B(me.form)=true then
msgbox "存在子窗体!"
end if