以下程序执行:当按“上一条”按钮,如果已经移到第一条时,按钮就设为不可显示,不能再按了但系统提示“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

解决方案 »

  1.   

    adodc1.recordset.movefirst 已经是第一条了就不用这一句试。
      

  2.   

    应该这样 If Adodc1.Recordset.BOF =true Then
      

  3.   

    以上的建议还是不对好像Command1.Enabled = False这句没有执行
      

  4.   

    Private Sub Command1_Click()
       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