Private Sub Command1_Click()
Data1.UpdateRecord
If Data1.Recordset.RecordCount <> 0 Then
Data1.Recordset.MoveLast
yy = Data1.Recordset.Fields("studentnum")
End If
Data1.Recordset.AddNew
Text1(1).SetFocus
Text1(1).SelStart = Len(Text1(1))
MsgBox "信息添加成功!", vbOKOnly, "提示"
End Sub