Private Function isopen()
Dim FOBJ As Form
isopen = 0
For Each FOBJ In Forms
If FOBJ.Name = "ex4-2-1" Then
isopen = 1
End If
Next
End Function
'以下是表单窗体Ex4-1-2的操作,用于取得表单窗体Ex4-2-1的物件值
Private Sub cmd01_Click() '取得表单Ex4-2-1中的TxtName
If isopen() = 1 Then
SSTR = ""
For nl = 1 To Forms("ex4-2-1")!NumTxt
SSTR = SSTR + Forms("ex4-2-1")!NameTxt + Chr(13) + Chr(10)
Next
End If
ListTab.Caption = SSTR
End Sub
Private Sub cmd02_Click()
'关闭表单Ex4-2-1
If isopen() = 1 Then
DoCmd.Close acForm, "ex4-2-1"
End If
[B][B][B]问题:为什么必需点击本窗体后,再点击按纽,才能取得Ex4-2-1窗体物件的当前值,而直接点击按纽却取出的是Ex4-2-1窗体物件的上次值???[/B][/B][/B]
End Sub