首先你不要给小白的视频误导,日期框是没有text的 只有Value ,你的代码是没有时间的,就这样写:
Tables("custorder").Filter="单据审核日期 >= #" & e.Form.Controls("DateTimePicker1").Value & "# and 单据审核日期 <=#" & e.Form.Controls("DateTimePicker2").Value & "# "
带时间:
Tables("custorder").Filter="单据审核日期 >= #" & e.Form.Controls("DateTimePicker1").Value & "# and 单据审核日期 <=#" & e.Form.Controls("DateTimePicker2").Value.AddDays(1) & "# "