[英]Slow Dlookup call in MS Access
I have an MS Access front end/back end database. 我有一个MS Access前端/后端数据库。 In the back end database I have a table keyed on FundCode.
在后端数据库中,我有一个键入FundCode的表。 The table has 4 fields and 150 records.
该表有4个字段和150个记录。 In the front end I have a form used to update a different table in the back end.
在前端,我有一个用于更新后端中不同表的表格。 When the user enters the FundCode on this form, I want to display the data in the three columns on the form - so the use can check they have chosen the correct fund code.
当用户在此表单上输入FundCode时,我想在表单的三列中显示数据-以便用户可以检查他们是否选择了正确的基金代码。 To display this I am using a textbox (not enabled) to display with a control being a Dlookup into my fund table eg
为了显示这一点,我正在使用一个文本框(未启用)进行显示,其中控件是Dlookup到我的资金表中,例如
=DLookUp("ISIN","tbl_FundMap","FundCode = " & [FundCode])
The code does what it supposed to do, but when I have around 100 entries in the form the it takes around 10 sec to refresh the screen every time a user rolls up or down. 该代码完成了它应做的工作,但是当我有大约100个表单输入时,每次用户上下滚动时,大约需要10秒钟刷新屏幕。 Any suggestions how I can achieve a quicker result?
有什么建议可以使我更快地获得结果吗?
Rather than using text boxes and the DLOOKUP
function, I would reccomend using combo boxes. 建议不要使用文本框和
DLOOKUP
函数,而是使用组合框。
The first combo box is where the user selects the actual FundCode
value. 用户可以在第一个组合框中选择实际的
FundCode
值。 The 2nd combo box, which is locked and/or disabled, also has its control source set to FundCode
, but its row source includes the ISIN
as the 2nd column. 第二个组合框(已锁定和/或禁用)也将其控制源设置为
FundCode
,但其行源包含ISIN
作为第二列。 That way, the 2nd combo box always shows the ISIN
based on the current FundCode
selected. 这样,第二个组合框将始终基于所选的当前
FundCode
显示ISIN
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.