If text1(0).Text <> "" Then
            Datahire1.Recordset.FindFirst "影碟库.编号 =  '" & text1(0).Text & "' "
        If Datahire1.Recordset.NoMatch Then
            msg = MsgBox("没有这部影片编号!", 48, "提示")
            text1(0).Text = ""
            Else
            Datahire1.RecordSource = "Select * From 影碟库 Where 影碟库.编号 like '" & text1(0).Text & "' "
            Datahire1.Refresh
        End If
    Else
            msg = MsgBox("请输入编号!", 48, "提示")
    End If我想填入的编号与数据库比较!然后显示出找到的数据项!
编译后在
Datahire1.Recordset.FindFirst "影碟库.编号 =  '" & text1(0).Text & "' "
系统提示 对象变量或 With 块变量没有设置(错误 91)
想问代码错在哪里??
如果代码中其他地方也有错误!请也顺便指名!
谢谢各位先

解决方案 »

  1.   

    不熟悉DAO,看过ADO,只好帮你顶
      

  2.   

    If text1(0).Text <> "" Then
                Datahire1.RecordSource = "Select * From 影碟库 Where 影碟库.编号 like '" & text1(0).Text & "' "
              Datahire1.Refresh
            If Datahire1.Recordset.NoMatch Then
                msg = MsgBox("没有这部影片编号!", 48, "提示")
                text1(0).Text = ""
            End If
        Else
                msg = MsgBox("请输入编号!", 48, "提示")
        End If
    试试。
      

  3.   

    to:  yassee(甲克虫 - 花开堪折直须折,莫待无花空折枝.) 这样在输入库里没有的数据编号时并不报警!
    If Datahire1.Recordset.NoMatch Then
                msg = MsgBox("没有这部影片编号!", 48, "提示")
                text1(0).Text = ""
            End If
    相当于没有用!
    请问怎么实现如果没有找到时的报警?!
      

  4.   

    to: 22wolf(绝地孤狼)
    在只有  
    Datahire1.RecordSource = "Select * From 影碟库 Where 影碟库.编号 like '" & text1(0).Text & "' "时!数据库是运行成功的!应该是代码的问题!