Data1.RecordSource = "SELECT * FROM 表1 WHERE " & m And n And t
-->
Data1.RecordSource = "SELECT * FROM 表1 WHERE " & m & " And " & n & " And " t
-->
Data1.RecordSource = "SELECT * FROM 表1 WHERE " & m & " And " & n & " And " t
if text(1).text<>"" then
tempsql=m & " and "
end if
if text(1).text<>"" then
tempsql=tempsql & m & " and "
end if
if text(1).text<>"" then
tempsql=tempsql & m & " and "
end if
tempsql=tempsql & "1"Data1.RecordSource = "SELECT * FROM 表1 WHERE " & tempsql你应该明白我意思吧!