sending current record to word 97 & decimal places

daybase

New member
Local time
Today, 17:03
Joined
Dec 22, 2000
Messages
8
Help - I am starting to venture beyond access reports and simple macros - my latest (of many problems) is that I am attempting send the current record to a word document using the following technique lifted from knowledge base:

Private Sub MergeButton_Click()
On Error GoTo MergeButton_Err
Dim objWord As Word.Application
Set objWord = CreateObject("Word.Application")
With objWord
.Visible = True
.Documents.Open ("c:\mdocuments\mymerge.doc")
.ActiveDocument.Bookmarks("First").Select
.Selection.Text = (CStr(Forms!Employees!FirstName))
.ActiveDocument.Bookmarks("earn").Select
.Selection.Text = (CCur(Forms!Employees!salary))

etc etc

My problem is that one of my fields is a currency variable but try as I might the currency formatting is lost when the data is posted to the word document. For example £12.50 becomes 12.5, £10.00 becomes 10 etc.

I have tried CCur, CSng etc. but to no avail - am I being very stupid? As the idea is to produce invoices this is a very important "glitch". Answers in simple terms (preferably with an example) please.
 
Don't have the answer to your question but why can't you produce your invoices directly from Access?
 
Invoices is the simple bit - there is more that I want to do - warning letters etc. And letters are so fiddly to set up in Access
 
I do everything from within mine, multiple letters,single, reminders,warning letters, etc. You can create stock letters warnings etc within yours and send them to whoever you want far easiear than the naff mail merge etc functions. Just create one report that gives the layout you want then copy it just changing the record sources.
HTH
 
I ran into the same problem and I solved it using the format function.

.Selection.Text = Format((CStr(Forms!Employees!salary)), "$#,##0.00")

Of course, mine is in dollar format, but I'm sure you know a way to use pounds (it is pounds right?)
smile.gif


~Charity
 
Charity - Thought the solution was something like that - tried every combination of (())'## etc etc but no luck. Thanks for making sense of it for me.


Rich - thanks for the suggestions
 

Users who are viewing this thread

Back
Top Bottom