以下程序执行:当按“上一条”按钮,如果已经移到第一条时,按钮就设为不可显示,不能再按了但系统提示“EOF或BOF有一条为真,应用程序仍然要执行。”,哪里错了??????Private Sub Command1_Click()
If Adodc1.Recordset.BOF Then
Command1.Enabled = False
Adodc1.Recordset.MoveFirst
Else
Adodc1.Recordset.MovePrevious
Combo1.Text = Adodc1.Recordset.Fields("sex")
Text7.Text = Adodc1.Recordset.Fields("number")
Text6.Text = Adodc1.Recordset.Fields("name")
Text2.Text = Adodc1.Recordset.Fields("systemname")
Text5.Text = Adodc1.Recordset.Fields("linkphone")
Text1.Text = Adodc1.Recordset.Fields("classname")
DTPicker1.Value = Adodc1.Recordset.Fields("birthday")
DTPicker2.Value = Adodc1.Recordset.Fields("studydate")
End IfEnd Sub
If Adodc1.Recordset.BOF Then
Command1.Enabled = False
Adodc1.Recordset.MoveFirst
Else
Adodc1.Recordset.MovePrevious
Combo1.Text = Adodc1.Recordset.Fields("sex")
Text7.Text = Adodc1.Recordset.Fields("number")
Text6.Text = Adodc1.Recordset.Fields("name")
Text2.Text = Adodc1.Recordset.Fields("systemname")
Text5.Text = Adodc1.Recordset.Fields("linkphone")
Text1.Text = Adodc1.Recordset.Fields("classname")
DTPicker1.Value = Adodc1.Recordset.Fields("birthday")
DTPicker2.Value = Adodc1.Recordset.Fields("studydate")
End IfEnd Sub
Adodc1.Recordset.MovePrevious
If Adodc1.Recordset.BOF Then
Adodc1.Recordset.MoveFirst
MsgBox "这是第一条记录", vbExclamation + vbOKOnly, "提示"
Command1.Enabled = False
Else
Command1.Enabled = True
End If
End Sub