[英]How to show a field as Currency but with the data type being Text - Access 2013
In my Access iv'e got a form in which I want to display several table-bound (record source) fields as Currency, with their table datatype being Text.在我的 Access 中,我有一个表单,我想在其中将几个表绑定(记录源)字段显示为货币,它们的表数据类型为文本。
I can't seems to get this done.我似乎无法完成这件事。 What I tried so far to achieve this:
到目前为止,我为实现这一目标所做的尝试:
Format
in the controlsource of the field so (in the controlsource of the field): =Format(MyTextNumber; "Currency")
- Results in #Type error (Circular reference)Format
(在字段的控制源中): =Format(MyTextNumber; "Currency")
- 结果在 #Type 错误(循环引用)CCur
in the controlsource of the field: =CCur(MyTextNumber)
- This returns all 0.00 amounts (with the currency symbol though) and also a Circular reference Error in the design.CCur
: =CCur(MyTextNumber)
- 这将返回所有 0.00 金额(尽管带有货币符号)以及设计中的循环引用错误。table
as Recordsource in the form I used a query as Recordsource in which I created another field based on the Field I try to change: SELECT *, Format(MyTextNumber, "Currency") as MyTextNumberWithFormat FROM SomeTable
I then used the MyTextNumberWithFormat
as controlsource, this returns good values but I can't edit these values directly because it is based on an expression.table
作为记录源,而是使用查询作为记录源,其中我根据尝试更改的字段创建了另一个字段: SELECT *, Format(MyTextNumber, "Currency") as MyTextNumberWithFormat FROM SomeTable
然后我使用了MyTextNumberWithFormat
作为控制源,这会返回良好的值,但我无法直接编辑这些值,因为它基于表达式。UPDATE
statement when the field is being changed (but couldn't get this to work either).UPDATE
语句(但也无法使其工作) . Any other suggestions?还有其他建议吗?
Additional information:附加信息:
I also tried to set the Format/Notation on Currency/Euro in the Formatting tab of the field but this also doesn't have any effect, though what is kinda interesting is the fact that when I use =Sum(MyField)
as Recordsource, then the Format/Notation Currency DOES work.我还尝试在字段的格式选项卡中设置货币/欧元的格式/符号,但这也没有任何效果,尽管有点有趣的是当我使用
=Sum(MyField)
作为记录源时,那么格式/符号货币确实有效。
SELECT Table1.Test, Format([test],"Currency") AS Expr1
FROM Table1;
this worked for me, I've entries of "£123.45" and "123.45" and were presented in currency.这对我有用,我输入了“£123.45”和“123.45”,并以货币形式显示。 You had ;
你有; in your's
在你的
Results in #Type error (Circular reference)
导致 #Type 错误(循环引用)
Then rename your textbox to something else than MyTextNumber
.然后将您的文本框重命名为
MyTextNumber
以外的其他MyTextNumber
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.