根据另一个表单的日期,在子表单上更改颜色的日期 [英] Have a date on a subform change colour depending on another form's date

查看:74
本文介绍了根据另一个表单的日期,在子表单上更改颜色的日期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想强调自上次会议以来在我的数据库中输入的新数据,因此很容易在子表格中看到哪些信息是新的。


In我的数据库我有一个名为CompoundsObservations的表,它包含一个名为DateOfInfoAdded的日期字段。

还有另一个名为LastMeetingDate的表,只有一个字段,一个名为LastMeeting的日期字段。此表仅用于注册上次会议的日期,并应作为突出显示的新信息的基础。


如何使DateOfInfo的日期为如果此日期晚于LastMeeting日期,那么CompoundsObservations子表单(放在名为Compounds的主表单上)将变为红色,后者在名为Lastmeeting的单独表单上输入?


我尝试过通过一个带有两个表之间的表达式的查询来实现这一点,并且实际上工作但很奇怪,?Group by?选项使CompoundsObservations查询的备注字段长度仅为255个字符(文本大小)。实际上并非所有文本都可见。当我关闭Group by选项时(所以表达式无效anymiore)所有文本都在那里。


我是Access的新手,所以仍然非常恐吓。

I want to highlight new data that has been entered in my database since a last meeting so it is easy to see in a subform?s table what info is new.

In my database I have a table called CompoundsObservations and that contains a date field called DateOfInfoAdded.
There is another table called LastMeetingDate with only one field, a date field called LastMeeting. This table only serves the purpose to register the last meeting''s date and should be the basis to highlight new information that was enetered as from.

How can I make the DateOfInfoAdded date of the CompoundsObservations subform (placed on the main form called Compounds) turn red when this date is later in time than the LastMeeting date, the latter entered on a separate Form called Lastmeeting?

I tried doing this through a Query with an Expression between the 2 tables and that actually worked but strange enough, the ?Group by? option makes the memo fields of the CompoundsObservations query become only 255 characters long (text size). So actually not all text is visible. When I turn the Group by option off (so the expression is not valid anymiore) all the text is there again.

I''m very new to Access so still quite intimidated.

推荐答案


我想突出显示自上次会议以来在我的数据库中输入的新数据,因此很容易在子表单中查看哪些信息是新的。


在我的数据库中,我有一个名为CompoundsObservations的表,其中包含一个名为DateOfInfoAdded的日期字段。

另一个名为LastMeetingDate的表只有一个字段,一个名为LastMeeting的日期字段。此表仅用于注册上次会议的日期,并应作为突出显示的新信息的基础。


如何使DateOfInfo的日期为如果此日期晚于LastMeeting日期,那么CompoundsObservations子表单(放在名为Compounds的主表单上)将变为红色,后者在名为Lastmeeting的单独表单上输入?


我尝试过通过一个带有两个表之间的表达式的查询来实现这一点,并且实际上工作但很奇怪,?Group by?选项使CompoundsObservations查询的备注字段长度仅为255个字符(文本大小)。实际上并非所有文本都可见。当我关闭Group by选项时(所以表达式无效anymiore)所有文本都在那里。


我是Access的新手,所以仍然非常恐吓。更新DateOfInfoAdded时,
I want to highlight new data that has been entered in my database since a last meeting so it is easy to see in a subform?s table what info is new.

In my database I have a table called CompoundsObservations and that contains a date field called DateOfInfoAdded.
There is another table called LastMeetingDate with only one field, a date field called LastMeeting. This table only serves the purpose to register the last meeting''s date and should be the basis to highlight new information that was enetered as from.

How can I make the DateOfInfoAdded date of the CompoundsObservations subform (placed on the main form called Compounds) turn red when this date is later in time than the LastMeeting date, the latter entered on a separate Form called Lastmeeting?

I tried doing this through a Query with an Expression between the 2 tables and that actually worked but strange enough, the ?Group by? option makes the memo fields of the CompoundsObservations query become only 255 characters long (text size). So actually not all text is visible. When I turn the Group by option off (so the expression is not valid anymiore) all the text is there again.

I''m very new to Access so still quite intimidated.



,对表执行DLookup以获取上次会议日期,并使用DateDiff函数确定DateOfInfoAdded是否晚于LastMeeting(以秒为单位)。


试试这个(未测试):

when the DateOfInfoAdded has been updated, Do a DLookup to the table to obtain last meeting date and use DateDiff function to determine if DateOfInfoAdded later than LastMeeting (in seconds).

Try this (not tested):

展开 | 选择 | Wrap < span class =codeDivider> | 行号


我试了但是它不起作用。我将更多地用它来看看我是否在某种程度上做错了什么。
I tried it but it doesn''t work. I will üplay around with it a bit more to see if I am somehow doing something wrong.



我试了但是它没有''工作。我将更多地了解它,看看我是否在某种程度上做错了什么。
I tried it but it doesn''t work. I will üplay around with it a bit more to see if I am somehow doing something wrong.



您知道如何使用调试窗口吗?如果是这样,请检查计算显示的值,并告诉我。


如果您不知道如何在Access中调试,请告诉我,我会告诉您该怎么做。


Do you know how to use the debug window? if so, check what values are showing for the computations, and let me know.

If you don''t know how to debug in Access, let me know and I will tell you what to do.


这篇关于根据另一个表单的日期,在子表单上更改颜色的日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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