0

我报告的表格中有一个颜色字段。我打算用一个基于单词的小方块颜色替换报告上的这个文本。

几天来,我一直在 Access 中进行挖掘,但似乎无法在 VBA 或“属性”窗格中找到任何选项。

更新:感谢汤姆为我指明了正确的方向,到目前为止,我已经完成了这种工作,决定使用文本框而不是矩形,因为这样我仍然可以在里面放置彩色文本。因此,我使用 Report_Current 事件编写了一个巨大的“Select Case Report_rptSRSearch.Colour”来处理这个问题。

然而,使用 Report_Current 事件似乎并没有提供确切所需的功能。它将完全按照我的意愿执行,除非用户实际单击报告上的记录。

4

2 回答 2

2

Not testing this, so my syntax may be off slightly.

Create your square on your form. In this example we'll call it square1. On the Form_Current event (VBA), check the value of the colour field, and using a Select Case statement, set the background colour of square1.

于 2012-08-01T04:46:27.153 回答
0

所以终于想通了,你必须使用 Detail_Paint 方法。呃;)

于 2012-08-06T05:40:51.823 回答