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.
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.