--
查询表设置的不加载任何数据,查询按钮代码如下(单击后只是显示加载树限制的行数,如果想在当前表里面显示满足查询条件的所有数据,如何设置):
Dim Filter As String
Dim trn As RibbonMenu.TextBox = RibbonTabs("功能区2").Groups("功能组5").Items("trucknum")
Dim sfa As RibbonMenu.TextBox = RibbonTabs("功能区2").Groups("功能组5").Items("sfaddress")
Dim sfn As RibbonMenu.TextBox = RibbonTabs("功能区2").Groups("功能组5").Items("sfnum")
Dim ssn As RibbonMenu.TextBox = RibbonTabs("功能区2").Groups("功能组5").Items("ssnum")
Dim std As RibbonMenu.DatePicker= RibbonTabs("功能区2").Groups("功能组5").Items("startdate")
Dim edd As RibbonMenu.DatePicker = RibbonTabs("功能区2").Groups("功能组5").Items("enddate")
Dim ry As RibbonMenu.CheckBox = RibbonTabs("功能区2").Groups("功能组5").Items("rdoyifu")
Dim rw As RibbonMenu.CheckBox = RibbonTabs("功能区2").Groups("功能组5").Items("rdoweifu")
\'Dim sfnn As RibbonMenu.NumericBox = RibbonTabs("功能区1").Groups("功能组5").Items("sfnn")
\'Dim ssnn As RibbonMenu.NumericBox = RibbonTabs("功能区1").Groups("功能组5").Items("ssnn")
With trn
If .text <> Nothing Then
Filter = "车号= \'" & .text & "\'"
End If
End With
With sfa
If .text <> Nothing Then
If Filter > "" Then
Filter = Filter & "And "
End If
Filter = Filter & "收发地点 like \'%" & .text & "%\'"
End If
End With
With sfn
If .text <> Nothing Then
If Filter >"" Then
Filter = Filter & "And "
End If
Filter = Filter & "实发数= " & .text
End If
End With
With ssn
If .text <> Nothing Then
If Filter >"" Then
Filter = Filter & "And "
End If
Filter = Filter & "实收数= " & .text
End If
End With
With std
If .Value <> Nothing Then
If Filter >"" Then
Filter = Filter & "And "
End If
Filter = Filter & "日期 >= #" & .Value & "#"
Vars("startdate") =.Value
End If
End With
With edd
If .Value <> Nothing Then
If Filter >"" Then
Filter = Filter & "And "
End If
Filter = Filter & "日期 <= #" & .Value & "#"
Vars("enddate") =.Value
End If
End With
If ry.Checked = True \' 如果付款状态选择了"已付"
If Filter >"" Then
Filter = Filter & "And "
End If
Filter = Filter & "运费结算实付日期 is not null"
End If
If rw.Checked = True \' 如果付款状态选择了"未付"
If Filter >"" Then
Filter = Filter & "And "
End If
Filter = Filter & "运费结算实付日期 Is Null"
End If
If Filter > "" Then
DataTables("运费查询").LoadFilter = Filter
DataTables("运费查询").load
‘Tables("运费查询").Filter = Filter
End If
[此贴子已经被作者于2014-12-30 20:59:38编辑过]