好象需要指定section,你自己试试

解决方案 »

  1.   

    SammyXu(我编程,纯属无奈) 
    的思路是对的,好像是:dim x
    for each x in datareport1.sections
      '判断x是否为label控件
      '判断x的name属性是否是label1
      '赋值
    next x
      

  2.   

    DataReport1.Sections("Title").Controls("TimeLbl").Caption = "测试"只要知道Sections与Label的名称就可以控制了。
      

  3.   

    StrSQL = "Select * from Table where ID= " & mRepID
        Set rs3 = New ADODB.Recordset
        rs3.Open StrSQL, cnnDB, adOpenKeyset, adLockOptimistic
        Set Report.DataSource = rs3
           Report.Orientation = rptOrientLandscape       '设报表的方向为横向
           Report.Sections("Sections1").Controls("Label1").Caption = "姓名" '设报表的label1显示姓名。
      

  4.   

    dim ctl,sect as objectfor each sect in datareport.sections
       for o in sect.controls
          select case typename(o)
               case "rptLabel"
                   o.caption="your request"
               case  ...
          end select
       next
    next sect