核心就是select语句
strSQL=“select *form ” & 表名
if 日期<>"" then
strSQL=strSQL & “ 日期=#” & 日期 & “#”
youtiaojian=true
endif
if 性别.text=“” then
if youtiaojian then strSql=strSql & " and "
strSQl=strSQL & “性别=‘’” &性别.text & “‘ ’”
youtiaojian=true
endif
if trim( text1)<>"" then
if youtiaojian then strSql=strSql & " and "
strSQl=strSQL &"'" & text1 & "' like 姓名"
youtiaojian=true
endif
然后就执行这个select语句就会获得记录集
再将记录集逐记录、逐字段写入你的表。