代码如下:
Public count As Integer
  With Adodc1
             .ConnectionString = "dsn=jczx"
             .UserName = "jczx1"
             .Password = ""
             .RecordSource = "SELECT * FROM djqsr WHERE打印标志 = '否'"
             .Refresh
  End With
 For count = 0 To Adodc1.Recordset.RecordCount
                With Adodc1.Recordset
                   Text1.Text = .Fields("铅品号")
                   Text2.Text = .Fields("批号")
                   Text3.Text = .Fields("生产单位")
                   Text4.Text = .Fields("标准编号")
                   Text5.Text = .Fields("生产日期")
                   Text14.Text = .Fields("化验日期")
                   Text15.Text = .Fields("化验员")
                   Format(Text8.Text, "#0.0000%") = .Fields("银Ag")
                   Format(Text10.Text, "#0.0000%") = .Fields("铜Cu")
                   Format(Text12.Text, "#0.0000%") = .Fields("锑Sb")
                   Format(Text7.Text, "#0.0000%") = .Fields("锡Sn")
                   Format(Text9.Text, "#0.0000%") = .Fields("砷As")
                   Format(Text1.Text, "#0.0000%") = .Fields("铋Bi")
                   Format(Text1.Text, "#0.0000%") = .Fields("铁Fe")
                   Format(Text1.Text, "#0.0000%") = .Fields("锌Zn")
                   Format(Text1.Text, "#0.0000%") = .Fields("总和")
                   Format(Text1.Text, "#0.0000%") = .Fields("铅Pb")
                   '.Fields ("打印标志")="是"
                   .Update
                  .MoveNext                End With
               form1.PrintForm
 Next count
错误提示:编译错误,变量要求-不能赋值到该表达式
光标停留在cout上
各位大侠请赐教呀!

解决方案 »

  1.   

    检查Adodc1.Recordset是否为nothing
      

  2.   

    感谢CathySun118(斯年)的关注.
    SQL语句在查询分析器里验证过了,有结果.
    不应该是Adodc1.Recordset的问题.
    请指教呀!
      

  3.   

    Format(Text8.Text, "#0.0000%") = .Fields("银Ag")
                       Format(Text10.Text, "#0.0000%") = .Fields("铜Cu")
                       Format(Text12.Text, "#0.0000%") = .Fields("锑Sb")
                       Format(Text7.Text, "#0.0000%") = .Fields("锡Sn")
                       Format(Text9.Text, "#0.0000%") = .Fields("砷As")
                       Format(Text1.Text, "#0.0000%") = .Fields("铋Bi")
                       Format(Text1.Text, "#0.0000%") = .Fields("铁Fe")
                       Format(Text1.Text, "#0.0000%") = .Fields("锌Zn")
                       Format(Text1.Text, "#0.0000%") = .Fields("总和")
                       Format(Text1.Text, "#0.0000%") = .Fields("铅Pb")
        
    语法错了!
      

  4.   

    谢谢ZOU_SEAFARER(颓废程序员^_^)的关注.
    所提建议已采纳.
    修改后提示:所需操作需要一个当前记录!
    但是SQL语句确实在SQL查询分析器里正常执行呀!
      

  5.   

    Adodc1.Recordset.addnew一条然后再UPDATE吧?
      

  6.   

    不好意思,没看全,无需addnew