你不能升级到最新版的foxtable?
1、控件不要绑定表列;
2、代码
按钮
Dim Filter As String
With e.Form.Controls("cmbProduct")
If .text <> Nothing Then
Filter = "适用款号 = '" & .text & "'"
End If
End With
With e.Form.Controls("cmbCustomer")
If .text <> Nothing Then
If Filter > "" Then
Filter = Filter & " And "
End If
Filter = Filter & "客户 = '" & .text & "'"
End If
End With
With e.Form.Controls("cmbpart")
If .text <> Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "部位 = '" & .text & "'"
End If
End With
With e.Form.Controls("StartDate")
If .Text <> Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "单据日期 >= #" & .text & "#"
End If
End With
With e.Form.Controls("EndDate")
If .text <> Nothing Then
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "单据日期 <= #" & .text & "#"
End If
End With
If e.Form.Controls("rdoHeXiao").Checked = True ' 如果已归还状态选择了"已归还"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "核销 = True"
End If
If e.Form.Controls("rdoweihe").Checked = True ' 如果核销状态选择了"未核"
If Filter >"" Then
Filter = Filter & " And "
End If
Filter = Filter & "核销 = False Or 核销 Is Null"
End If
If Filter > "" Then
msgbox(filter)
Tables("借出").Filter = Filter
End If
各个控件TextChanged事件
Dim btn As WinForm.Button = e.Form.Controls("查询")
btn.PerformClick