将报告限制为日期范围 [英] Limiting a Report to a Date Range

查看:77
本文介绍了将报告限制为日期范围的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我按照http://allenbrowne.com/tips.html上方法2的说明将报告限制为适合我的报告的日期范围。


但是,由于在表单上的截止日期字段中插入了错误的日期(必须在数据表视图中),我必须创建一个包含正确日期列表的组合框它们存储为文本并链接到另一个组合框。这也很有效。


现在,当我从StartDate和EndDate表单运行报表时,没有任何记录出现。我假设它与日期存储为文本有关?我尝试将它们存储为日期,但是当我尝试从数据表中的组合框中插入日期时,我收到一条错误,上面写着您输入的值对该字段无效。


有什么我可以在代码中更改以使表单再次运行吗?

I followed the instructions of Method 2 on the http://allenbrowne.com/tips.html for limiting a report to a date range which worked perfectly for my report.

However, because of incorrect dates being inserted into a Due Date field on the form (which has to be in datasheet view) I had to create a combo box with a list of correct dates which are stored as text and linked to another combo box. This also works well.

Now though when I run my report from the StartDate and EndDate form no records appear. I?m assuming it has to do with the dates being stored as text? I tried storing them as dates but when I tried inserting the date from the combo box in the datasheet I got an error saying "The value you entered isn?t valid for the field".

Is there something I can change in the code to get the form working again?

推荐答案

组合的日期框应该是日期,而不是文本。


不知道查询的内容是什么,但是应该有类似的东西

The dates for your combo box should be dates, not text.

Without knowing what the query is for your report but is should have something like

展开 < span class =codeDivider> | 选择 | Wrap | Line数字


Phil,最初我将组合框设为日期字段,但是当您从组合框中的列表中选择日期时,您会收到消息您输入的值对于fi无效eld,这就是我将其更改为文本框的原因。
Phil, originally I made the combo box a date field but when you choose a date from the list in the combo box you get the message "The value you entered isn’t valid for the field", that''s why I changed it to a text box.


组合框的RowSource究竟是什么,绑定列是什么?

Combo的AfterUpdate上是否发生了宏或VBA?

如果是,请暂时删除它,以便我们可以隔离您的错误发生位置。


Phil
What exactly is the RowSource for your Combo boxes and which is the bound column?

Is there a Macro or VBA happening on the AfterUpdate of the Combos?
If so, temporarily remove it, so that we can isolate where your error is occurring.

Phil


这篇关于将报告限制为日期范围的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆