Set mrc3 = RunSelect("select * from 温度表1 where 时间 >= '" & DTPicker1.Value & " 00:00:00' and 时间 <= '" & DTPicker1.Value & " 23:59:59'")
思路正确,但代码有SQL语法错误, form改成 from
Dim mrc3 As ADODB.Recordset
Set mrc3 = RunSelect("select * form 温度表1 where 时间<‘#" & DTPicker1.Value & ”#’“)
Set Form5.DataGrid1.DataSource = mrc3