Rss & SiteMap

Foxtable(狐表) http://www.foxtable.com

新一代数据库软件,完美融合Access、Foxpro、Excel、vb.net之优势,人人都能掌握的快速软件开发工具!
共12 条记录, 每页显示 10 条, 页签: [1] [2]
[浏览完整版]

标题:请问如何在窗口中列出未来一个月生日的人的信息?

1楼
dark272710 发表于:2011/8/23 14:04:00

要实现,打开窗口,就能列出未来一个月生日的人的信息。

 

想直接在窗口中列出,不知道能做到么?

 

只知道这一句。。接下来不知道怎么写,求教

If e.Row("列名").Addmonths(1) < Date.Today Then

2楼
狐狸爸爸 发表于:2011/8/23 14:18:00

参考这个:

 

http://www.datasoft.com.cn/dispbbs.asp?BoardID=2&ID=11929&skin=0

 

3楼
dark272710 发表于:2011/8/23 15:20:00

这个是用MessageBox的~

 

我还想实现一些证书到期复核之类的工作。。。所以想要列出来,看的方便啊

4楼
狐狸爸爸 发表于:2011/8/23 15:21:00

不想提示的话,你可以删除这段代码中的MessageBox的,默认就会自动列出来的。

多个提示不是更好吗?

 

5楼
dark272710 发表于:2011/8/25 12:40:00

抱歉一开始没仔细看代码,的确实现了我需要的功能,谢谢

 

还有一个小问题,我有些信息,时间是空的,也会列出来,怎么加入一个空值排除的判断。我if后面用and提示语法错误,用isnotnull也不行。。。谢谢

 

Dim ids As String
Dim cnt As Integer
Dim nms As String
For Each dr As DataRow In DataTables("证书信息").DataRows
    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(","))
    Tables("证书信息").filter = "[_Identify] In (" & ids.Trim(",") &")"
End If

6楼
czy 发表于:2011/8/25 13:22:00
不要对DataRows进行遍历,用DataTables的Select方法可以排除空值,不妨试试。
7楼
狐狸爸爸 发表于:2011/8/25 14:11: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(","))
    Tables("证书信息").filter = "[_Identify] In (" & ids.Trim(",") &")"
End If
[此贴子已经被作者于2011-8-25 14:11:30编辑过]
8楼
dark272710 发表于:2011/8/26 8:35:00

谢谢!要学的还有很多啊

9楼
dark272710 发表于:2011/8/26 9:56:00

想要同时实现数据加亮的功能,也是同样的问题,一些空白的行也被加亮了

 

这是写在Drawcell里的~~

If e.Row("复核日期").Addmonths(-1) < Date.Today Then
    e.Style = "需复核"
End If

 

 

10楼
狐狸爸爸 发表于:2011/8/26 9:57:00

If e.Row("复核日期").Addmonths(-1) < Date.Today AndAlso e.Row.IsNull("复核日期") = False  Then
     e.Style = "需复核"
End If

 

参考:

http://www.foxtable.com/help/topics/0595.htm

http://www.foxtable.com/help/topics/0426.htm

 

[此贴子已经被作者于2011-8-26 10:13:03编辑过]
共12 条记录, 每页显示 10 条, 页签: [1] [2]

Copyright © 2000 - 2018 foxtable.com Tel: 4000-810-820 粤ICP备11091905号

Powered By Dvbbs Version 8.3.0
Processed in .02734 s, 2 queries.