以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  全局表DrawCell代码部分失效,怎么解决  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=60788)

--  作者:xjc620
--  发布时间:2014/12/1 12:42:00
--  全局表DrawCell代码部分失效,怎么解决
If e.Table.Name = "当月二保" Then
    \'代码
If e.Col.Name = "靠挂费日期" Then
    Dim d1 As Date = e.Row("靠挂费日期")
    Dim d2 As Date = e.Row("应维护日期")
    If Format(d1,"yyyyMM") > Format(d2, "yyyyMM") Then
        e.Text = Nothing
    End If
End If
End If

If e.Col.Name = "靠挂费日期" AndAlso e.Row.Isnull(e.Col.Name) = False Then

    e.Text = Format(e.Row(e.Col.Name), "yyyy-MM")

End If

由于靠挂费日期显示为yyy-mm上组代码不执行怎么解决


--  作者:Bin
--  发布时间:2014/12/1 14:05:00
--  
不可能,除非列名不是这个,  你看看标题和列名有没搞错.
--  作者:Bin
--  发布时间:2014/12/1 14:05:00
--  
你不会是两段代码放到一起吧?
--  作者:xjc620
--  发布时间:2014/12/1 14:13:00
--  
是在一起啊,全在全局表事件里啊
--  作者:有点甜
--  发布时间:2014/12/1 14:14:00
--  
 If e.Table.Name = "当月二保" Then
    \'代码
    If e.Col.Name = "靠挂费日期" AndAlso e.Row.Isnull(e.Col.Name) = False Then
        e.Text = Format(e.Row(e.Col.Name), "yyyy-MM")       
    End If
    If e.Col.Name = "靠挂费日期" Then
        Dim d1 As Date = e.Row("靠挂费日期")
        Dim d2 As Date = e.Row("应维护日期")
        If Format(d1,"yyyyMM") > Format(d2, "yyyyMM") Then
            e.Text = Nothing
        End If      
    End If
End If


--  作者:Bin
--  发布时间:2014/12/1 14:15:00
--  
你放在一起,完全搞不懂你想做什么.

是这个意思?.

[此贴子已经被作者于2014-12-1 14:15:45编辑过]

--  作者:xjc620
--  发布时间:2014/12/1 14:19:00
--  
这样就只有当月二保表里的靠挂费日期显示为yyy-mm了,其它表里不变了
--  作者:xjc620
--  发布时间:2014/12/1 14:23:00
--  
是不是因为相比较大小的两个列显示格式不一样才会产生无效的啊
--  作者:有点甜
--  发布时间:2014/12/1 14:30:00
--  
If e.Table.Name = "当月二保" Then
    \'代码
    If e.Col.Name = "靠挂费日期" Then
       
        Dim d1 As Date = e.Row("靠挂费日期")
        Dim d2 As Date = e.Row("应维护日期")
        If Format(d1,"yyyyMM") > Format(d2, "yyyyMM") Then
            e.Text = Nothing
        Else
            If e.Row.Isnull(e.Col.Name) = False Then
                e.Text = Format(e.Row(e.Col.Name), "yyyy-MM")
            End If
        End If
    End If
End If