Export to Word and keep currency format (1 Viewer)

JPR

Registered User.
Local time
Today, 11:42
Joined
Jan 23, 2009
Messages
159
Hello, back for some help.
I am having problem when exporting data to Word. On my form ( records source is Table1), I have a textbox (Amounte), with format Euro and decimals as Auto. When I type or open the form, the value in textbox Amounte is displayed correctly (ex. €100.50). When I export to Work, in the document, I will get only 100 (without the decimals).

I understand that Access reads the machine currency setting, but just cannot find a solution. I need this control to be left as currency as it is also used to perform calculation. Thank you

Code:
On Error Resume Next
Dim objWord As Object
Dim strPath As String

strPath = DLookup("[TemplateLocation]", "TablePath", "[TemplateID]='" & Me.[txtMyWordFile & "'")

Set objWord = CreateObject("Word.Application")
objWord.Visible = False
objWord.Documents.Add strPath

objWord.ActiveDocument.Bookmarks("Amounte").Select
objWord.Selection.Text = me.Amounte

 objWord.Visible = True
 

Ranman256

Well-known member
Local time
Today, 14:42
Joined
Apr 9, 2015
Messages
3,934
Did you try:
objWord.Selection.Text = format(me.Amounte,"currency")
 

JPR

Registered User.
Local time
Today, 11:42
Joined
Jan 23, 2009
Messages
159
Thanks. I works in part as it now give me the decimals but always shows the value with the $ sign although the textbox is formatted as Euro.
 

Gasman

Enthusiastic Amateur
Local time
Today, 19:42
Joined
Sep 21, 2011
Messages
9,025
Thanks. I works in part as it now give me the decimals but always shows the value with the $ sign although the textbox is formatted as Euro.
Something wrong with your currency then?

Code:
? format(22.95,"Currency")
£22.95
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Tomorrow, 02:42
Joined
May 7, 2009
Messages
14,021
why not just Create a Report.
 

Gasman

Enthusiastic Amateur
Local time
Today, 19:42
Joined
Sep 21, 2011
Messages
9,025
Edit: there is a Euro format, which is meant to work, but when I try, I just get the word Euro?:unsure:
Code:
tt=2222.95
tt1= format(tt,"euro")
? tt1
euro

Just changed my currency to euro, and

Code:
? format(22.95,"currency")
€22.95
£22.95
The bottom one was before I changed to euro.?
 
Last edited:

bastanu

AWF VIP
Local time
Today, 11:42
Joined
Apr 13, 2010
Messages
865
Maybe also look into using a switch for the bookmark in your Word template:

Cheers,
 

Users who are viewing this thread

Top Bottom