窗体求教高手,谢谢!!!!有三个窗体:
form1: command1,command2
form2: text1,command1
form3: text1,command1
代码:
form1:
Private Sub Command1_Click()
Set aaa = New Form2
aaa.Show
End Sub
Private Sub Command2_Click()
Set aaa = New Form2
aaa.Show
End Subform2:
Private Sub Command1_Click()
Form3.Show
End Subform3:
Private Sub Command1_Click()
aaa.Text1 = Me.Text1
End Sub模块:
Public aaa As Form2我想在两个新窗体都打开后,在两个窗体分别点击命定打开form3,我想当点击form3上命定,分别把form3上的text1得值赋予相应新窗体aaa上的text1即:如两个新窗体都加载了,在后打开的窗体上点击命定打开form3,当点击form3上命定,把form3上的text1得值赋予后打开窗体上的text1,再在先打开的窗体上点击命定打开form3,当点击form3上命定,把form3上的text1得值赋予先打开窗体上的text1求教高手帮助,谢谢!!!
form1: command1,command2
form2: text1,command1
form3: text1,command1
代码:
form1:
Private Sub Command1_Click()
Set aaa = New Form2
aaa.Show
End Sub
Private Sub Command2_Click()
Set aaa = New Form2
aaa.Show
End Subform2:
Private Sub Command1_Click()
Form3.Show
End Subform3:
Private Sub Command1_Click()
aaa.Text1 = Me.Text1
End Sub模块:
Public aaa As Form2我想在两个新窗体都打开后,在两个窗体分别点击命定打开form3,我想当点击form3上命定,分别把form3上的text1得值赋予相应新窗体aaa上的text1即:如两个新窗体都加载了,在后打开的窗体上点击命定打开form3,当点击form3上命定,把form3上的text1得值赋予后打开窗体上的text1,再在先打开的窗体上点击命定打开form3,当点击form3上命定,把form3上的text1得值赋予先打开窗体上的text1求教高手帮助,谢谢!!!
........
.......
form3: ‘把text1的值赋予打开本窗体的那个窗体上的text1
Private Sub Command1_Click() '此处代码该如和写,谢谢!!!
'如在先打开的新窗体上打开本窗体,就把text1的值赋予先打开的新窗体上的text1
'如在后打开的新窗体上打开本窗体,就把text1的值赋予后打开的新窗体上的text1
End Sub
............
.............
aaa(0).Show
End Sub
Private Sub Command2_Click()Set aaa(1) = New Form2
aaa(1).Show
End Subform2:Option ExplicitPrivate Sub Command1_Click()
If aaa(0).Command1 Then
i = 0
Else
i = 1
End If
Form3.Show
End Sub
form3:
Option ExplicitPrivate Sub Command1_Click()
aaa(i).Text1.Text = Form3.Text1.TextEnd Sub
模块:
Option ExplicitPublic aaa(1)Public i As Integer