以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]某一列如果包含指定字符,则在备注列显示相应的内容,请求修改代码  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=99671)

--  作者:hrw68529
--  发布时间:2017/4/24 15:08:00
--  [求助]某一列如果包含指定字符,则在备注列显示相应的内容,请求修改代码

If e.DataCol.Name = "鉴定类别" Then
    Select Case e.DataRow("鉴定类别")
        Case "%因果%"
            e.DataRow("备注") = "因果关系鉴定"
        Case "%器具%"
            e.DataRow("备注") = "辅助器具配置"
                          
    End Select
End If

--  作者:有点色
--  发布时间:2017/4/24 15:10:00
--  

不能用Select Case

 

必须用If Then

 

If e.DataRow("鉴定类别") Like "*因果*" Then

 

ElseIf e.DataRow("鉴定类别") Like "*器具*" Then

 

End If


--  作者:hrw68529
--  发布时间:2017/4/24 15:12:00
--  
好的,我试试


--  作者:hrw68529
--  发布时间:2017/4/24 15:20:00
--  
If e.DataRow("鉴定类别") Like "*因果*"  Then
    e.DataRow("备注") ="因果关系鉴定"
ElseIf
e.DataRow("鉴定类别") Like "*器具*"  Then
    e.DataRow("备注") ="辅助器具鉴定"
Else
    e.DataRow("备注") =Nothing
  End If

提示:elseif 应为表达式,出现错误


--  作者:hrw68529
--  发布时间:2017/4/24 15:23:00
--  
好了,谢谢