表单文本框中的IsErr()表达式 [英] IsErr() Expression in Form Text Box

查看:68
本文介绍了表单文本框中的IsErr()表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Access数据库(继承) 它是基于DBF文件使用链接表管理器。我们正在经历一个名为F18,F19到F23的其他字段的过渡。字段名称是故意无意义的。

I have an Access database (inherited) that is based DBF files using the Linked Table Manager. We are going through a transition with some additional fields called F18, F19 to F23. The field names are intentionally meaningless.

每个月的每一天都有一个DBF 文件。当天的文件具有固定名称,前几天的文件已重命名,其中日期嵌入在文件名中。这可能是重要的,因为用户访问"历史"的方式。
表是选择日期,此时正确的"历史"表是表/文件在代码中自动链接。当天的DBF链接是静态的。

There is a DBF file for each day of the month. The file for the current day has fixed name and the files for previous days have been renamed with the date embedded in the file name. This may be significant because the way the user accesses "historical" tables is to choose a date, at which point the correct "historical" table/files is linked automatically in code. The DBF link for the current day is static.

为了适应过渡期,我在当前日期和历史(过去几天)表单中添加了文本框,其表达式为

To accommodate the transition period, I have added text boxes to the current day and historical (past days) forms with expressions such as

IIf(IsError([F18],Null,[F18])

IIf(IsError([F18], Null, [F18])

这适用于"历史"形式,但不适用于"当前"形式对于存在的字段,它会显示正确的值,对于缺少的字段,它会显示"#Name?"的正确值。我只是无法弄清楚为什么它在一个表单上工作,但
不在另一个表单上。

This works for the "historical" form but not for the "current day" form. It displays correct values for fields that exist and "#Name?" for fields that are missing. I just can't figure out why this works on one form but not the other.

R Campbell

R Campbell

推荐答案

如果文本框控件与字段名称相同,则显示"#Name?";例如,如果文本框控件名为"F18",则将文本框控件重命名为例如"txtF18"。

You get the "#Name?" displayed if the textbox control has the same name as the field, e.g. if the textbox control is named "F18". Rename the textbox control to to e.g. "txtF18".

MatthiasKläy,KläyComputingAG

Matthias Kläy, Kläy Computing AG


这篇关于表单文本框中的IsErr()表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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