Access Data into Word - Number formats

  • Thread starter Thread starter Grandma
  • Start date Start date
G

Grandma

Guest
I am opening word from an Access module and successfully inserting data from Access form controls into a document template.
However, I am having trouble with number/currency fields. If the number has two '0' decimal places, only the whole (integer) number appears in Word with no decimal.

Any solutions welcome!
 
Use the FORMAT function to format the number before inserting it. Do a search in Access VBA Help for Format.

EXAMPLES:
' User-defined formats.
MyStr = Format(5459.4, "##,##0.00") ' Returns "5,459.40".
MyStr = Format(334.9, "###0.00") ' Returns "334.90".
MyStr = Format(5, "0.00%") ' Returns "500.00%".

MyStr = Format("HELLO", "<") ' Returns "hello".
MyStr = Format("This is it", ">") ' Returns "THIS IS IT".
 

Users who are viewing this thread

Back
Top Bottom