查询按钮事件中生成子窗体的查询语句
dim SQL as string
SQL="select * from 银行交易明细表 where 1=1 "
if not isnull(me.text付款日期) then SQL =SQL & " and 付款日期<=#" me.text付款日期 & "#"
if not isnull(me.text子公司) then SQL =SQL & "and 子公司=" & me.text子公司
if not isnull(me.text银行卡标识) then SQL =SQL & " and 银行卡标识='" & me.text银行卡标识 & "'"
Me.子窗体对象名.Form.RecordSource=SQL
只是示例,根据你字段类型可能语句要稍稍修改
哪里有问题?我可以帮你