查找字段显示为数字值,而不是Access报告上的文本 [英] Lookup field appears as numerical values instead of text on Access report
问题描述
我正在尝试创建一个报告,并放置一个名为contact
的字段,其中包含一个人的名字.此名称直接链接到我保留所有联系人的另一个表.
I am trying to create a report putting a field called contact
which has the name of a person. This name is linked directly to another table where I keep all the contacts.
出于某种奇怪的原因,当我包括此姓名(在查询视图中显示为联系人的姓名)时,该姓名而不是姓名出现在报告中.
For some strange reason, when I include this name (which in query view displays as the name of the contact), instead of the name appearing, the unique ID number is shown on my report.
推荐答案
如文章中所述上面的注释,您可以在报表上使用组合框控件来为您查找.要查看如何完成此操作,请基于包含查找字段的表创建一个新报表,然后将该字段拖放到报表上.这将创建一个组合框控件,其属性如下所示:
As mentioned in the article cited in the above comment, you can use a Combo Box control on your report to do the lookup for you. To see how this can be done, create a new report based on the table containing the lookup field, then drag and drop that field onto the report. That will create a Combo Box control with properties that look something like this:
行来源:SELECT [Clients].[ID], [Clients].[LastName] FROM Clients;
绑定栏:1
列数:2
列宽:0";1"
Row Source: SELECT [Clients].[ID], [Clients].[LastName] FROM Clients;
Bound Column: 1
Column Count: 2
Column Widths: 0";1"
您可以在实际报告中使用类似的组合框控件来显示客户的姓名,而不是其数字ID值.
You could use a similar Combo Box control on your actual report to display the client's name rather than their numeric ID value.
另一种替代方法是更改报表的文本框"控件的Control Source
,使其在表上执行DLookUp()
.如果查找字段命名为[client],则将文本框的Control Source
更改为类似的
Another alternative would be to change the Control Source
of the report's Text Box control to have it do a DLookUp()
on the table. If the lookup field is named [client] then changing the Control Source
of the Text Box to something like
=DLookUp("LastName","Clients","ID=" & [client])
也可以.
这篇关于查找字段显示为数字值,而不是Access报告上的文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!