Private Sub cmdAdd_Click()
Data1.Recordset.AddNew
End Sub
Private Sub cmdDelete_Click()
'如果删除记录集的最后一条记录
'记录或记录集中唯一的记录
Data1.Recordset.Delete
Data1.Recordset.MoveNext
End Sub
Private Sub cmdRefresh_Click()
'这仅对多用户应用程序才是需要的
Data1.Refresh
End Sub
Private Sub cmdUpdate_Click()
Data1.UpdateRecord
Data1.Recordset.Bookmark = Data1.Recordset.LastModified
End Sub
Private Sub cmdClose_Click()
Unload Me
End Sub
Private Sub Command1_Click()
End Sub
Private Sub Data1_Error(DataErr As Integer, Response As Integer)
'这就是放置错误处理代码的地方
'如果想忽略错误,注释掉下一行代码
'如果想捕捉错误,在这里添加错误处理代码
MsgBox "数据错误事件命中错误:" & Error$(DataErr)
Response = 0 '忽略错误
End Sub
Private Sub Data1_Reposition()
Screen.MousePointer = vbDefault
On Error Resume Next
'这将显示当前记录位置
'为动态集和快照
Data1.Caption = "记录:" & (Data1.Recordset.AbsolutePosition + 1)
'对于 Table 对象,当记录集创建后并使用下面的行时,
'必须设置 Index 属性
'Data1.Caption = "记录:" & (Data1.Recordset.RecordCount * (Data1.Recordset.PercentPosition * 0.01)) + 1
End Sub
Private Sub Data1_Validate(Action As Integer, Save As Integer)
'这是放置验证代码的地方
'当下面的动作发生时,调用这个事件
Select Case Action
Case vbDataActionMoveFirst
Case vbDataActionMovePrevious
Case vbDataActionMoveNext
Case vbDataActionMoveLast
Case vbDataActionAddNew
Case vbDataActionUpdate
Case vbDataActionDelete
Case vbDataActionFind
Case vbDataActionBookmark
Case vbDataActionClose
End Select
Screen.MousePointer = vbHourglass
End Sub
Private Sub 查寻_Click()
????????????????就这里!~~~~~
End Sub
Private Sub Text1_Change()
End Sub