DLookup代码的问题。得到我无法弄清楚的错误 [英] problem with DLookup code. Getting error that I can't figure out

查看:75
本文介绍了DLookup代码的问题。得到我无法弄清楚的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这有点复杂,但我会尽力解释。在我的数据库中,我有一个名为L_AgeCorrection的表,其中包含以下字段:年龄,性别,频率,AgeValue


这是一个用于为听力测试结果指定年龄校正值的表 - 由于老化会自然发生一定程度的听力损失 - OSHA允许我们在确定员工是否具有实际的重要状态之前进行计算。听力损失。


无论如何...我的主要表格F_Demographics带有标签控件。其中一个标签用于听力图。这有当前的听力图字段,我们输入测试日期,测试类型和测试结果。此选项卡还有一个嵌套在其中的子表单,用于显示员工的基线听力图结果。我需要比较当前和基线的结果,但我会在年龄后更正它们。所以这是我尝试这样做的一个例子。在听力图的选项卡上,我使用After Update事件进行查找并获取年龄校正值。我有未绑定的字段来放置调整后的值,然后是未绑定的字段以便稍后计算差异。


但是对于查找表,这里是我提出的代码...

This is a little complicated but I''ll do my best to explain. In my db I have a table called L_AgeCorrection which has the following fields: Age, Sex, Frequency, AgeValue

This is a table used to assign an Age Correction value to hearing test results - since some degree of hearing loss naturally occurs with aging - OSHA lets us calculate that in before determining if the employee has an actual "significant" hearing loss.

Anyway...I have my main form F_Demographics with a tabbed control. One of the tabs is for audiograms. This has the current audiogram fields where we enter the date of test, type of test, and test results. This tab also has a subform nested in it to show the employee''s baseline audiogram results. I need to compare the current and baseline results but AFTER I correct them for age. So here is an example of how I attempted to do this. On the tab for audiogram I used the After Update event to do a lookup and get the age correction values. I have unbound fields to put the Adjusted values and then unbound fields to later calculate the difference.

But for the lookup table here is the code I came up with...

展开 | 选择 | Wrap | 行号

推荐答案

将DLookUp替换为:
Replace you DLookUp with this:
展开 | 选择 | Wrap | 行号


不幸的是没有不要......
Unfortunately that didn''t do it...


@rleepac


好​​的我注意到了你还有一些你有问题的地方,
@rleepac
Ok I noticed you have a few more places where you have issues,
展开 | 选择 | Wrap | 行号


这篇关于DLookup代码的问题。得到我无法弄清楚的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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