以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.net/bbs/index.asp)
--  专家坐堂  (http://foxtable.net/bbs/list.asp?boardid=2)
----  代码错误指教  (http://foxtable.net/bbs/dispbbs.asp?boardid=2&id=76196)

--  作者:yaojun
--  发布时间:2015/10/23 13:14:00
--  代码错误指教

原来编制了个项目,试用没有出现过问题,今天安装到另外一台电脑上试用,就出现了错误,其代码如下:

Dim Page As WinForm.TopicPage
    Dim cnt9 As String
    Dim cnt10 As String
    Dim cnt11 As String
    cnt9 =cnt9 &       User.Name
    cnt10 =cnt10 & Date.Today
    cnt11 =cnt11 &  " 星期" & "日一二三四五六".Chars(Today.DayOfWeek)
Page = e.Form.Controls("TopicBar1").Pages.Add("系统提示","系统提示")
          Page.Links.Add("欢迎登陆:","欢迎登陆:(" & cnt9 & ")" )
          Page.Links.Add("当前时间:","当前时间:(" & cnt10 & ")" )
          Page.Links.Add("今天星期:","今天星期:(" & cnt11 & ")" )
Dim Page1 As WinForm.TopicPage
Dim cnt1 As Integer = DataTables("订单").Compute("Count(下单日期)","下单日期 = #"  & Date.Today & "#")
Dim cnt2 As Integer = DataTables("订单").Compute("Count(交货日期)","交货日期 = #"  & Date.Today.AddDays(1) & "#")
Page = e.Form.Controls("TopicBar1").Pages.Add("订单资料","订单资料")
Page.Links.Add("今日新增订单","今日新增订单(" & cnt1 & ")" )
Page.Links.Add("明天准备生产","明天准备生产(" & cnt2 & ")" )
Dim Page2 As WinForm.TopicPage
Dim cnt3 As Integer = DataTables("采购单").Compute("Count(下单日期)","下单日期 = #"  & Date.Today & "#")
Dim cnt4 As Integer = DataTables("采购明细").Compute("Count(计划回厂)","计划回厂 = #"  & Date.Today.AddDays(1) & "#")
Page = e.Form.Controls("TopicBar1").Pages.Add("采购资料","采购资料")
Page.Links.Add("今日采购下单","今日采购下单(" & cnt3 & ")" )
Page.Links.Add("明日必催材料","明日必催材料(" & cnt4 & ")" )


Dim Page3 As WinForm.TopicPage
Dim cnt5 As Integer = DataTables("入库单").Compute("Count(入库日期)","入库日期 = #"  & Date.Today & "#")
Dim cnt6 As Integer = DataTables("领料单").Compute("Count(领料日期)","领料日期 =  #"  & Date.Today & "#")
Dim cnt7 As Integer = DataTables("入库明细").Compute("Count(入库日期)","入库日期 = #"  & Date.Today & "#")
Dim cnt8 As Integer = DataTables("领料明细").Compute("Count(交易日期)","交易日期 =  #"  & Date.Today & "#")
Page = e.Form.Controls("TopicBar1").Pages.Add("仓库资料","仓库资料")
Page.Links.Add("今日仓库入库","今日仓库入库(" & cnt5 & ")" )
Page.Links.Add("今日仓库发料","今日仓库发料(" & cnt6 & ")" )
Page.Links.Add("今日入库笔数","今日仓库入库(" & cnt7 & ")" )
Page.Links.Add("今日发料笔数","今日仓库发料(" & cnt8 & ")" )

 

请求老师指教

错误图示如下:

 



图片点击可在新窗口打开查看此主题相关图片如下:qq截图20151023130842.png
图片点击可在新窗口打开查看

--  作者:大红袍
--  发布时间:2015/10/23 14:48:00
--  

设置成短日期

 

http://jingyan.baidu.com/article/647f0115925aee7f2148a8b5.html


--  作者:yaojun
--  发布时间:2015/10/23 15:10:00
--  

谢谢红袍老师,谢谢,可以了


--  作者:张良才
--  发布时间:2015/10/23 23:14:00
--  
如何用代码判断、设置电脑的日期格式?
--  作者:大红袍
--  发布时间:2015/10/26 10:58:00
--  
以下是引用张良才在2015/10/23 23:14:00的发言:
如何用代码判断、设置电脑的日期格式?

 

看其字符长度如

 

msgbox(cstr(Date.Now).length)

msgbox(cstr(Date.today).length)