'替换你所有代码,应该可以完成你所需要的
'写数据库程序还是不要用控件,不要用绑定,用ado代码完成吧,灵活、专业,可完成大项目
Private Sub Command1_Click()
If Not IsNumeric(Text1) Then
Text1 = 0
Else
Text1 = Val(Text1) + 1
End If
End Sub
Private Sub Command2_Click()
Dim a As Integer
If Not Adodc1.Recordset.EOF Then Adodc1.Recordset.MoveLast
a = Val(Text1) + 1
Adodc1.Recordset.AddNew
Text1 = a
If Not IsDate(Text2) Then Text2 = Date
If Not IsDate(Text3) Then Text3 = Time
Adodc1.Recordset.Update
End Sub
Private Sub Command3_Click()
End
End Sub
Private Sub Form_Load()
Text.Text = ""
End Sub