这是什么意思?Private Sub Form_Activate()

来源:百度知道 编辑:UC知道 时间:2024/06/09 08:08:44
Private Sub Form_Activate()
Data1.DatabaseName = App.Path & "\" & "sjk.mdb"
Data1.RecordSource = "class"
Data1.Refresh

Data2.DatabaseName = App.Path & "\" & "sjk.mdb"

End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)
If KeyCode <> 8 Then
If Len(Text1.Text) = 4 Then
Text1.Text = Text1.Text & "-"
Text1.SelStart = Len(Text1.Text)
End If
If Len(Text1.Text) = 6 Then
End If
End If
End Sub

Private Sub Form_Activate() '当窗口被激活时
Data1.DatabaseName = App.Path & "\" & "sjk.mdb" '定义数据库路径
Data1.RecordSource = "class" '定义绑定的数据库中的表为CLASS
Data1.Refresh '刷新一下

Data2.DatabaseName = App.Path & "\" & "sjk.mdb" ''定义SATA2的数据库路径

End Sub
Private Sub Text1_KeyUp(KeyCode As Integer, Shift As Integer)'当在TEXT1中输入内容时键盘按键弹起时引发以下操作
If KeyCode <> 8 Then '如果按下的不是空格键,空格键的键值=8
If Len(Text1.Text) = 4 Then '如果内容长度等于4(英文与中文字符均算一个字)
Text1.Text = Text1.Text & "-" '在四个字符后面自动加上一个"-"
Text1.SelStart = Len(Text1.Text) '并使输入光标停在最后一个字的后面(SelStart为选择的起始点,如为0则为第一个字之前)
End If
If Len(Text1.Text) = 6 Then '如果字符数=6
End If '什么也不做
End If
End Sub

Private Sub Form_Activate()
这句是窗体激活的意思
下面语句的主要意思是窗体激活时重新导入数据库
end sub