VBA Format Number

A

AJOLSON

I have a word document that is mail merged with access. I have a number that
is formatted in Access to be a percent However when I merge it with the
word document I get .23 instead of 23%. I know I have to set the format to
read as percent but cant figure out how to do that in word. I have VB –
Basic opened for the document an have this code:

Format([DailyAveOIl1], "Percent") But it does not work [DailyAveOil1] is
the merged field.

Any help would be great. Thanks

Andy
 
M

macropod

Hi Andy,

In Word:
.. select your mergefield, which will look something like «Percent»
.. press Ctrl-F9 to wrap another field around it, thus - { «Percent» }
.. edit the field so that you get {=«Percent»*100 \# 0.00%}
.. press F9 to update the field
.. run your mailmerge

Note: the precision of the displayed value is controilled by the '0.00'. You can use anything from '0' to '0.000000000000000'.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top