没问题:
Private Sub DataReport_Initialize()
dim strtest as string 
strtest=rsttest.filed(0)
if strtest="a" then
    Me.Sections("section4").Controls("lblid").Caption = "#"
elseif strtest="b" then
     Me.Sections("section4").Controls("lblid").Caption = "$"
elseif strtest="c" thenend ifend sub请给分!~_~

解决方案 »

  1.   

    那你说清楚啊,方法太多了,分太少!什么数据库?如SQL serverselect test1 =(case when filed1='a' then '#' 
                   case when filed1='b' then '$'
                   case ' ' 
                   end)
     from table1 ok!!!!
      

  2.   

    法1: 同misterzhao,用 SQL 解决
    法2:
    用 dataFormat 对象,先引用 Microsoft Data Formatting Object Libary
    在 DataReport 模块添加:
    Dim WithEvents dataFormatX As StdDataFormat
    Private Sub dataFormatX_Format(ByVal DataValue As StdFormat.StdDataValue)
    If DataValue = 1 Then
       DataValue = "@"
       ...
    End If
    End Sub
    在 DataReport_Initialize 添加:
    set dataFormatX=new StdDataFormat
    set Me.Sections("section4").Controls("Text1").DataFormat=dataFormatX
      

  3.   

    参阅
    《VB6 之数据格式化对象使用技巧》
    http://microinfo.top263.net/Txt/Format.txt