以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]优化代码  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=106188)

--  作者:有点甜
--  发布时间:2017/9/4 12:20:00
--  
If e.DataCol.Name = "客户" Then
    If e.NewValue Is Nothing Then
        e.DataRow("身份证号") = Nothing
        e.DataRow("地址") = Nothing
        e.DataRow("电话") = Nothing
    Else
        Dim bms() As String = {"客户1","客户2","客户3","客户4"}
        For Each bm As String In bms
            Dim dr As DataRow
            dr = DataTables(bm).Find("[客户] = \'" & e.NewValue & "\'")
            If dr IsNot Nothing
                e.DataRow("身份证号") = dr("身份证号")
                e.DataRow("地址") = dr("地址")
                e.DataRow("电话") = dr("电话")
            End If
        Next
    End If
End If