终于有人加入讨论了:思路是怎样,我有一张表,叫装箱单,我用以下的代码进行筛选没有问题:代码如下:
Dim Filter As String
With e.Form.Controls("ddh")
If .Value IsNot Nothing Then
Filter = "IO = '" & .Value & "'"
End If
End With
With e.Form.Controls("KA")
If .Value IsNot Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "口岸 = '" & .Value & "'"
End If
End With
With e.Form.Controls("ys")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "运输方式 = '" & .Value & "'"
End If
End With
With e.Form.Controls("BZ")
If .Value IsNot Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "包装 = '" & .Value & "'"
End If
End With
If Filter > "" Then
Tables("装箱单").Filter = Filter
End If
这个代码是可以筛选出我所要的东西,因为装箱单表是含有这四列的.但是我们的系统不是可以做同步筛选的嘛,所以我加入底下的一段代码:
Tables("订箱单").Filter =tables("装箱单").Filter
Tables("出运资料").Filter =tables("装箱单").Filter
Tables("装箱统计").Filter =tables("装箱单").Filter
Tables("裁剪数").Filter =tables("装箱单").Filte
Dim ValAs String = e.Form.Controls("DDH").Value
Dim Filter As string
Filter ="[IO] = '" & Val & "'"
DataTables("裁剪数").LoadFilter = Filter
DataTables("裁剪数").Load()
DataTables("订单明细").LoadFilter = Filter
DataTables("订单明细").Load()
加上了这一段代码后,就出现了找不到[运输方式]列的提示!
明白了吗