简体   繁体   中英

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.

I can't seems to get this done. What I tried so far to achieve this:

  • Use a Format in the controlsource of the field so (in the controlsource of the field): =Format(MyTextNumber; "Currency") - Results in #Type error (Circular reference)
  • Use 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.
  • Instead of using the 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.
  • Also tried to create a hidden field with the controlsource and create an 'empty controlsource field' that uses the hidden field as its value and then write my own UPDATE statement when the field is being changed (but couldn't get this to work either).

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.

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. You had ; in your's

Results in #Type error (Circular reference)

Then rename your textbox to something else than MyTextNumber .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM