For i = 1 To countt
        If rs2.EOF = False Then
            csbhstr = rs2.Fields(0).Value
        End If
             Call liucode(code)
             strstr = "INSERT INTO purapp VALUES(" & psbh.Text & "," & code & "," & csbhstr & ","",0,0,0," & jhpz.Text & "," & hbyq.Text & "," & jhjd.Text & "," & jgqk.Text & "," & phd.Text & "," & jfzd.Text & "," & ceyf.Text & "," & fwpz.Text & "," & fwjd.Text & "," & phd2.Text & "," & ceyf2.Text & ",'" & Trim(jlz.Text) & "','" & jlrq.Text & "')"
             conn2.Execute (strstr)
    Next i
红色的报错   run-time error '424' object required  
大侠们研究一下。。TKS

解决方案 »

  1.   

    查看 psbh.Text 类的,*.Text的控件是否都存在。
      

  2.   

    strstr = "INSERT INTO purapp VALUES(" & psbh.Text & "," & code & "," & csbhstr & ","",0,0,0," & jhpz.Text & "," & hbyq.Text & "," & jhjd.Text & "," & jgqk.Text & "," & phd.Text & "," & jfzd.Text & "," & ceyf.Text & "," & fwpz.Text & "," & fwjd.Text & "," & phd2.Text & "," & ceyf2.Text & ",'" & Trim(jlz.Text) & "','" & jlrq.Text & "')"
    错误提示说的很明显了,对象不存在。这里有十几个文本框,你是从人家那复制的代码吧,看懂了再用。
      

  3.   

    str=" INSERT INTO 表名(字符型字段名,数据型字段名) VALUES('"& 字符型变量 &"',"& 数值型变量 &")"
      

  4.   

    应该是某个textbox控件不存在或者是名称写错
      

  5.   

    这个光看看不出来的,断点debug