以文本方式查看主题

-  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=32818)

--  作者:dycjj
--  发布时间:2013/5/8 21:00:00
--  高手们帮我看看,问题出在哪里

Dim dr As DataRow
dr = DataTables("会员表").Find("会员编号 = " & "\'" & e.DataRow("会员编号") & "\'" )
If e.DataCol.Name = "会员编号" Then
    If e.NewValue Is Nothing Then
        e.DataRow("姓名") = Nothing
        e.DataRow("性别") = Nothing
        e.DataRow("年龄") = Nothing
        e.DataRow("联系电话") = Nothing
    Else
        If dr IsNot Nothing  Then
            e.DataRow("姓名") = dr("会员姓名")
            e.DataRow("性别") = dr("性别")
            e.DataRow("年龄") = dr("年龄")
            e.DataRow("联系电话") = dr("联系电话")
        End If
    End If
Else
    If  e.DataCol.Name = "hybh" Then
        If e.NewValue Is Nothing Then
            e.DataRow("xm") = Nothing
            e.DataRow("xb") = Nothing
            e.DataRow("nl") = Nothing
            e.DataRow("lxdh") = Nothing
        Else
            If dr IsNot Nothing  Then
                e.DataRow("xm") = dr("会员姓名")
                e.DataRow("xb") = dr("性别")
                e.DataRow("nl") = dr("年龄")
                e.DataRow("lxdh") = dr("联系电话")
            End If
        End If
    End If
End If

为什么代码的下半段总是不成立呢


--  作者:程兴刚
--  发布时间:2013/5/8 22:11:00
--  

Dim dr As DataRow
dr = DataTables("会员表").Find("会员编号 = \'" & e.DataRow("会员编号") & "\'" )
If e.DataCol.Name = "会员编号" Then
    If e.NewValue Is Nothing Then
        e.DataRow("姓名") = Nothing
        e.DataRow("性别") = Nothing
        e.DataRow("年龄") = Nothing
        e.DataRow("联系电话") = Nothing
    Else
        If dr IsNot Nothing Then
            e.DataRow("姓名") = dr("会员姓名")
            e.DataRow("性别") = dr("性别")
            e.DataRow("年龄") = dr("年龄")
            e.DataRow("联系电话") = dr("联系电话")
        End If
    End If
end if
If e.DataCol.Name = "hybh" Then
    If e.NewValue Is Nothing Then
        e.DataRow("xm") = Nothing
        e.DataRow("xb") = Nothing
        e.DataRow("nl") = Nothing
        e.DataRow("lxdh") = Nothing
    Else
        If dr IsNot Nothing Then
            e.DataRow("xm") = dr("会员姓名")
            e.DataRow("xb") = dr("性别")
            e.DataRow("nl") = dr("年龄")
            e.DataRow("lxdh") = dr("联系电话")
        End If
    End If
End If


--  作者:dycjj
--  发布时间:2013/5/9 0:19:00
--  
程总,还是不行啊,要不你帮我看看项目
 下载信息  [文件大小:   下载次数: ]
图片点击可在新窗口打开查看点击浏览该文件:管理项目1.foxdb


--  作者:mamuaiqing
--  发布时间:2013/5/9 3:50:00
--  

Dim dr As DataRow
dr = DataTables("会员表").Find("会员编号 = \'" & e.DataRow("会员编号") & "\'" )
If e.DataCol.Name = "会员编号" Then
    If e.DataRow.IsNull("会员编号") Then
        e.DataRow("姓名") = Nothing
        e.DataRow("性别") = Nothing
        e.DataRow("年龄") = Nothing
        e.DataRow("联系电话") = Nothing
    Else
        e.DataRow("姓名") = dr("会员姓名")
        e.DataRow("性别") = dr("性别")
        e.DataRow("年龄") = dr("年龄")
        e.DataRow("联系电话") = dr("联系电话")
    End If
ElseIf e.DataCol.Name = "hybh" Then
    If e.DataRow.IsNull("hybh") Then
        e.DataRow("xm") = Nothing
        e.DataRow("xb") = Nothing
        e.DataRow("nl") = Nothing
        e.DataRow("lxdh") = Nothing
    Else
        e.DataRow("xm") = dr("会员姓名")
        e.DataRow("xb") = dr("性别")
        e.DataRow("nl") = dr("年龄")
        e.DataRow("lxdh") = dr("联系电话")
    End If
End If

 

表中测试正常