HTML Format Currency

Lifesavers,

I have some coding that pulls access fields into an email, yet the email doesn’t show it in the same format as what is on the front end version of my DB.  The fields are down as ‘Currency’ with ‘Auto’ decimal places in the back-end of my DB so figures I have formatted to 2 decimals on the field in the front-end.

 

However the coding is just pulling the figure in and not the format which I suppose I can understand.

 

Front end view is £2,208,48 or £902.00 or £31,371,93

But view on email is 2208.48 or 902 or 31371.93

 

I can get the £ added no problem, but I can’t get the comma in or it to 2 decimal places.

 

If I was to change the back-end properties of the field to 2 decimal places from auto, would this fix the issue or just part of the issue leaving me to find the comma solution?  I have 60 users that access our DB, so would need all out of DB in order to make change to the back-end DB, so would only want to do this if I knew this was the solution.

Or

Is there a way through my line of code to add the format function of x,xxx.xx so I can just make change on the front-end of the DB and then send out to users?

 

& "<p>Therefore, I recommend that we nominate the above to deliver this project and place a PO for the amount detailed below." & "<p>Total SubContract Spend - <b>£" & Forms![frmCommercial_New].[Approved Project Budget] & "<p>Margin</b>"

 

I’ve done some searching through the net and have seen some possibilities, but none have yet to work on my code.

 

Appreciate your time

Answer
Answer

You have the answer. HTML doesn't understand Access formatting. So it sees a number and presents it as a number. You have to convert it to text when adding to the HTML. The Format function will do that. 

& "<p>Therefore, I recommend that we nominate the above to deliver this project and place a PO for the amount detailed below." & "<p>Total SubContract Spend - <b>" & Format(Forms![frmCommercial_New].[Approved Project Budget],Currency) & "<p>Margin</b>"

Hope this helps,
Scott<>
Blog: http://scottgem.wordpress.com
Microsoft Access MVP since 2007

1 person found this reply helpful

·

Was this reply helpful?

Sorry this didn't help.

Great! Thanks for your feedback.

How satisfied are you with this reply?

Thanks for your feedback, it helps us improve the site.

How satisfied are you with this reply?

Thanks for your feedback.

 
 

Question Info


Last updated September 30, 2020 Views 3,694 Applies to: