From: Len on
Why is this code not working?

Me!TAXAMT = CCur(Me!TAXAMT)

When I click on a button to calculate sales tax, it still shows the seven
didgets.

The above instruction was 6.957333

Still showed 6.9.57333 not 6.96.

I thought the CCur rounded to Currency?

Help wound be appreciated and Thanks in Advance

Len
From: Daryl S on
Len -

Currency is set to 4 decimal places. Not sure why you have 5 after the calc.
--
Daryl S


"Len" wrote:

> Why is this code not working?
>
> Me!TAXAMT = CCur(Me!TAXAMT)
>
> When I click on a button to calculate sales tax, it still shows the seven
> didgets.
>
> The above instruction was 6.957333
>
> Still showed 6.9.57333 not 6.96.
>
> I thought the CCur rounded to Currency?
>
> Help wound be appreciated and Thanks in Advance
>
> Len
From: Len on
Thanks for getting back to me.

What is the code to set it to two positions?

I guess I am confused because I have worked with international monitary
funds and no one in the world goes more than 3 decimals.

"Daryl S" wrote:

> Len -
>
> Currency is set to 4 decimal places. Not sure why you have 5 after the calc.
> --
> Daryl S
>
>
> "Len" wrote:
>
> > Why is this code not working?
> >
> > Me!TAXAMT = CCur(Me!TAXAMT)
> >
> > When I click on a button to calculate sales tax, it still shows the seven
> > didgets.
> >
> > The above instruction was 6.957333
> >
> > Still showed 6.9.57333 not 6.96.
> >
> > I thought the CCur rounded to Currency?
> >
> > Help wound be appreciated and Thanks in Advance
> >
> > Len
From: John Quinn on
Len;

I can see you have a very old program.

If Me!TaxAmt is from the form than you must code it as follows:

Dim sglTax as Single

sglTax = Me!TaxAmt
sglTax = Round([sglTax],2)
Me!TaxAmt = sglTax

CCur was changed from 2 to 4 decimals about four years ago.

Microsoft went to the IBM DB II instruction.

Good Luck

J.Q.

"Len" wrote:

> Why is this code not working?
>
> Me!TAXAMT = CCur(Me!TAXAMT)
>
> When I click on a button to calculate sales tax, it still shows the seven
> didgets.
>
> The above instruction was 6.957333
>
> Still showed 6.9.57333 not 6.96.
>
> I thought the CCur rounded to Currency?
>
> Help wound be appreciated and Thanks in Advance
>
> Len
From: Daryl S on
Len -

You can use the Round function:

Me!TAXAMT = Round(Me!TAXAMT,2)

--
Daryl S


"Len" wrote:

> Thanks for getting back to me.
>
> What is the code to set it to two positions?
>
> I guess I am confused because I have worked with international monitary
> funds and no one in the world goes more than 3 decimals.
>
> "Daryl S" wrote:
>
> > Len -
> >
> > Currency is set to 4 decimal places. Not sure why you have 5 after the calc.
> > --
> > Daryl S
> >
> >
> > "Len" wrote:
> >
> > > Why is this code not working?
> > >
> > > Me!TAXAMT = CCur(Me!TAXAMT)
> > >
> > > When I click on a button to calculate sales tax, it still shows the seven
> > > didgets.
> > >
> > > The above instruction was 6.957333
> > >
> > > Still showed 6.9.57333 not 6.96.
> > >
> > > I thought the CCur rounded to Currency?
> > >
> > > Help wound be appreciated and Thanks in Advance
> > >
> > > Len