我是根据
http://www.foxtable.com/help/index.html?n=2297.htm这个,做的按时间加载菜单,代码如下:MainTable = Tables("订单库")
Tables("订单库").OpenView("订单视图")
Dim StartDate As Date
Dim EndDate As Date
With RibbonTabs("单据管理")("单据日期查询")
StartDate = .Items("StartDate").Value
EndDate = .Items("EndDate").Value
End With
If _UserGroup ="供应商" Then
DataTables("订单库").LoadFilter= "[日期] >= #" & StartDate & "# And [日期] <= #" & EndDate & "# and 供应商 = '" & _UserName & "'"
DataTables("订单库").Load
DataTables("订单详情").LoadFilter= "[订单日期] >= #" & StartDate & "# And [订单日期] <= #" & EndDate & "# and 供应商 = '" & _UserName & "'"
DataTables("订单详情").Load
ElseIf _UserGroup ="客户组" Then
DataTables("订单库").LoadFilter= "[日期] >= #" & StartDate & "# And [日期] <= #" & EndDate & "# and 客户名称 = '" & _UserName & "'"
DataTables("订单库").Load
DataTables("订单详情").LoadFilter= "[订单日期] >= #" & StartDate & "# And [订单日期] <= #" & EndDate & "# and 客户名 = '" & _UserName & "'"
DataTables("订单详情").Load
End If
本地测试,没有问题,定向到SQL网络数据源后, 提示"#"附近代码错误?请高手指点