以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  请教个问题?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=70420)

--  作者:zsslly
--  发布时间:2015/6/21 12:06:00
--  请教个问题?
我的主表中,"记录月份"列的内容为"xx年xx月"      14年01月......14年12月        15年01月......15年12月    16年01月......16年12月  ......

我设计的窗口中的“combobox1”控件中的内容为:   2014年、2015年、2016年、2017年、、、、、、
 



如果控件中的内容也为“xx年xx月”的话,代码如下写,我知道的,

e.Form.Controls("Table1").Table.Filter = "记录月份 = \'" & e.Form.Controls("ComboBox1").Text & "\'"

但如果内容形式不一样的话应该怎么改呢?求助?




--  作者:zsslly
--  发布时间:2015/6/21 12:38:00
--  
求教老师?
--  作者:zsslly
--  发布时间:2015/6/21 12:55:00
--  
有大神指点吗?
--  作者:zsslly
--  发布时间:2015/6/21 13:20:00
--  
Dim s As String = e.Sender.Text
Dim d As Date = new Date (2000 + s.substring(0,2), s.substring(3,2), s.substring(6,2))
\'msgbox(d)
Tables("主窗口_Table22").Filter = "事件日期 = #" & d & "#"


这个方法不知道能不能用?

--  作者:zsslly
--  发布时间:2015/6/22 9:29:00
--  
在次求助?


--  作者:sloyy
--  发布时间:2015/6/22 12:08:00
--  
用两个combobox比较好,一个显示年,一个显示月 再组合起来.
--  作者:zsslly
--  发布时间:2015/6/22 15:35:00
--  
求助?
--  作者:大红袍
--  发布时间:2015/6/23 11:17:00
--  
e.Form.Controls("Table1").Table.Filter = "记录月份 like \'" & e.Form.Controls("ComboBox1").Text.SubString(2,3) & "%\'"