年前真是忙昏头了,结果代码也不是很难。。。
感谢各位大大过年还回帖
代码如下:希望能帮到各位
With Forms("租金台帐查询").Controls("ComboBox1") '控件值非空判断
If.Value Is Nothing Then
Messagebox.Show("请输入查询月份")
Else
Dim xl As WinForm.ComboBox = e.Form.Controls("ComboBox1")
Tables("租金台帐查询_应收租金").Filter="计租月份 Like '*" & xl.Text & "'" '查询左表
Dim d As String = e.Form.Controls("ComboBox1").text '定义各个变量
Dim d1 As String
Dim d2 As String
d1 = d.SubString(0,4) '将字符串拆开
d2 = d.Substring(4,2)
Dim dt1 As Date = new Date (d1,d2,1) '生成查询的月份首天
Dim dt2 As Date = new Date (d1,d2, Date.DaysInMonth(d1,d2)) '生成查询的月份末天
Tables("租金台帐查询_企业缴费流水").Filter="缴费时间 >= #" & dt1 & "# and 缴费时间 <= #" & dt2 & "#"
End If
End With