From: BB on
On May 13, 12:49 pm, Salad <sa...(a)oilandvinegar.com> wrote:
> BB wrote:
> > On May 12, 3:38 am, Roger <lesperan...(a)natpro.com> wrote:
>
> >>I tried this with access97 and it works fine
>
> > Thanks Roger.
>
> > Is there anyone out there who can try it with Access 2007?  It's
> > driving me crazy!
>
> Maybe this will work.  Then again, maybe not
> x = 0.5999
> ? formatnumber(x,2)
> 0.60
> ? formatnumber(x,4)    'default leading 0
> 0.5999
> ? formatnumber(x,4,0)  'no leading 0.  -1 to force leading 0
> .5999
>
> There are newsgroups related to Excel.  Maybe try one of them like
> microsoft.public.excel.worksheet.functions

Bingo! That did it! Using:

.NumberFormat = "$0.0000"
.Value = FormatNumber(pvValue, 4, vbFalse)

for the assignment did the trick. Even though FormatNumber tells it
not to use a leading zero, the .NumberFormat property on the previous
line puts in both a dollar symbol and the leading zero. Strange, but
true!

Thanks, Salad!