以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]增加复制条件  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=196048)

--  作者:苏州老街
--  发布时间:2025/3/25 15:18:00
--  [求助]增加复制条件
老师,我想再增加一个复制条件列名称为“房屋主体”,谢谢老师。

If e.DataCol.Name = "项目" Then
    If e.DataRow.IsNull("项目") = False AndAlso e.DataRow.IsNull("抄表日期") = False Then
        Dim dr1 As DataRow = e.DataTable.Find("项目=\'" & e.NewValue & "\' and 抄表日期 is not null and _sortkey <" & e.DataRow("_sortkey"),"_sortkey desc")
        If dr1 IsNot Nothing Then
            e.DataRow("分表上期") = dr1("分表本期")
[此贴子已经被作者于2025/3/25 15:18:42编辑过]

--  作者:有点蓝
--  发布时间:2025/3/25 15:22:00
--  
Dim dr1 As DataRow = e.DataTable.Find("项目=\'" & e.NewValue & "\' and 房屋主体=\'xxx\' and 抄表日期 is not null and _sortkey <" & e.DataRow("_sortkey"),"_sortkey desc")
--  作者:苏州老街
--  发布时间:2025/3/25 15:43:00
--  
老师,不是黄标出的这个意思,我是想再增加一个条件判断即:“项目”和”房屋主体”,如红色标出的判断的代码。
If e.DataCol.Name = "项目" Then
Dim dr1 As DataRow = e.DataTable.Find("项目=\'" & e.NewValue & "\' and 
房屋主体=\'xxx\' and 抄表日期 is not null and _sortkey <" & e.DataRow("_sortkey"),"_sortkey desc")
[此贴子已经被作者于2025/3/25 15:50:29编辑过]

--  作者:有点蓝
--  发布时间:2025/3/25 15:50:00
--  
没看懂
--  作者:苏州老街
--  发布时间:2025/3/25 18:26:00
--  

此主题相关图片如下:2025-03-17 12 19 54.png
按此在新窗口浏览图片
If e.DataCol.Name = "项目" Then
    If e.DataRow.IsNull("项目") = False AndAlso e.DataRow.IsNull("抄表日期") = False Then
        Dim dr1 As DataRow = e.DataTable.Find("项目=\'" & e.NewValue & "\' and 抄表日期 is not null and _sortkey <" & e.DataRow("_sortkey"),"_sortkey desc")
        If dr1 IsNot Nothing Then
            e.DataRow("一号楼_上期") = dr1("一号楼_本期")

--  作者:有点蓝
--  发布时间:2025/3/25 19:45:00
--  
Dim dr1 As DataRow = e.DataTable.Find("项目=\'" & e.NewValue & "\' and 房屋主体=\'" & e.DataRow("房屋主体") & "\' and 抄表日期 is not null