我对这一行有疑问:
Private Sub Command0_Click()
DoCmd.OpenReport "Daily Report", AcView.acViewPreview, , "rDate =#" & txtDate & "#"
End Sub
我试图根据txtDate中日期的值制作可打印的每日报告。
答案 0 :(得分:0)
尝试添加时间段:
DoCmd.OpenReport "Daily Report", AcView.acViewPreview, , "rDate >= DateValue(" & txtDate & ") And rDate < DateAdd('d', 1, DateValue(" & txtDate & "))"