MS Access 表单字段显示格式

发布于 2024-09-07 15:04:08 字数 276 浏览 1 评论 0原文

我们正在开发一个使用 MS Acces 2003 和 SQL Server 2005 的应用程序。
我们正在保存一个包含文本数据的字段,例如 002215.28,但我们希望以特殊格式将其显示在屏幕上,例如 00 22 15.28

为此,我们在“表单设计”工具栏和“格式”属性框中键入自定义格式
00 00 00.##\.####
但是当我们打开表单屏幕时,数据看起来就像保存在表格中一样,

请您提供建议

We are working on an application using MS Acces 2003 and SQL Server 2005.
We are saving a fields that contain a text data for example 002215.28 but we want to display it on the screen in a special format for example like this 00 22 15.28.

To do so on the Form Design toolbar and in the Format property box, we type a custom format
00 00 00.##\.####
but when we open the form screen the data appear like it was saved in the table

Please may you advise

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

轻许诺言 2024-09-14 15:04:08

看来该列可能是文本列,如果是这样,您需要说,@@ @@ @@\.@@

要使用数字格式格式化控件,您必须首先使用例如 Val 转换为数字:

=Val([TextString])

确保该控件与列的名称不同,请调用它,例如 txtTextString。

这样做有各种缺点,包括:

  • 控件不可编辑
  • Val 将为 alpha 返回零,给出 00 00 00..
  • Val 将为 Null 值返回错误

最后两个并不难解决。

如果第一个是问题,您可能需要考虑使用一些 VBA 来填充该字段。

It seems that the column may be a text column, if so, you need say, @@ @@ @@\.@@

To format the control using number formats, you must first convert to number with, say, Val:

=Val([TextString])

Make sure that the control does not have the same name as the column, call it, say txtTextString.

There are various disadvantages to this, including:

  • The control is not editable
  • Val will return zero for alphas, giving 00 00 00..
  • Val will return an error for Null values

The last two are not difficult to work around.

If the first is a problem, you may have to consider some VBA to fill the field.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文