以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]提示  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=63525)

--  作者:风声
--  发布时间:2015/1/22 17:14:00
--  [求助]提示

Dim ids As String
Dim cnt As Integer
Dim nms As String
For Each dr As DataRow In DataTables("应收款").Select("兑现日期 Is Not Null")
    Dim dt As Date = dr("兑现日期")
    dt =  New Date(dt.year,dt.Month,dt.Day)
    If Date.Today.AddMonths(1) > dt Then
        cnt = cnt + 1
        ids = ids & "," & dr("_Identify")
        nms = nms & dr("客户")& "-" & dr("票据名称")& " , "
    End If
Next
If cnt > 0 Then
    messagebox.show("未来一个月内有" & cnt & "张票据到期, 分别是 : " & nms.Trim(","),"票据到期提示")
End If

MainTable = Tables("应收款")

 

老师,上面的代码对到期和过期的兑现日期都进行了提示,我只想对到期的兑现日期提示。谢谢


--  作者:有点甜
--  发布时间:2015/1/22 17:26:00
--  
Dim ids As String
Dim cnt As Integer
Dim nms As String
For Each dr As DataRow In DataTables("应收款").Select("兑现日期 Is Not Null")
    Dim dt As Date = dr("兑现日期")
    If Date.Today.AddMonths(1) > dt AndAlso dt >= Date.Today Then
        cnt = cnt + 1
        ids = ids & "," & dr("_Identify")
        nms = nms & dr("客户")& "-" & dr("票据名称")& " , "
    End If
Next
If cnt > 0 Then
    messagebox.show("未来一个月内有" & cnt & "张票据到期, 分别是 : " & nms.Trim(","),"票据到期提示")
End If

--  作者:风声
--  发布时间:2015/1/22 18:17:00
--  
谢谢老师
--  作者:风声
--  发布时间:2015/1/29 8:39:00
--  
以下是引用有点甜在2015-1-22 17:26:00的发言:
Dim ids As String
Dim cnt As Integer
Dim nms As String
For Each dr As DataRow In DataTables("应收款").Select("兑现日期 Is Not Null")
    Dim dt As Date = dr("兑现日期")
    If Date.Today.AddMonths(1) > dt AndAlso dt >= Date.Today Then
        cnt = cnt + 1
        ids = ids & "," & dr("_Identify")
        nms = nms & dr("客户")& "-" & dr("票据名称")& " , "
    End If
Next
If cnt > 0 Then
    messagebox.show("未来一个月内有" & cnt & "张票据到期, 分别是 : " & nms.Trim(","),"票据到期提示")
End If

老师,上面的代码只是到期的提示,我要按下按钮时没有到期也有一个提示"没有到期的事项"


--  作者:Bin
--  发布时间:2015/1/29 8:40:00
--  
If cnt > 0 Then
    messagebox.show("未来一个月内有" & cnt & "张票据到期, 分别是 : " & nms.Trim(","),"票据到期提示")
Else
   messageob.show("没有到期的事项")
End If

四条尾巴啦,简单的变通都不会么?

--  作者:风声
--  发布时间:2015/1/29 8:49:00
--  
谢谢老师,我把尾巴砍掉算了
--  作者:风声
--  发布时间:2015/1/29 8:56:00
--  

图片点击可在新窗口打开查看此主题相关图片如下:360软件小助手截图20150129085751.png
图片点击可在新窗口打开查看
提示错误
--  作者:Bin
--  发布时间:2015/1/29 8:58:00
--  
亲...作为一个四尾狐, 你搞不定这个错误.就算了.
--  作者:Bin
--  发布时间:2015/1/29 9:02:00
--  
只会复制代码,从来都没学习,没动脑过,那永远都不会呀.
--  作者:风声
--  发布时间:2015/1/29 14:02:00
--  
以下是引用Bin在2015-1-29 8:40:00的发言:
If cnt > 0 Then
    messagebox.show("未来一个月内有" & cnt & "张票据到期, 分别是 : " & nms.Trim(","),"票据到期提示")
Else
   messageob.show("没有到期的事项")
End If

四条尾巴啦,简单的变通都不会么?

上面两个代码有区别吗