From: LRay67 on
I have a form that has two fields that are not calculating right.

[RemoteNumberHours] = 0.25
[NumberPCS] = 1

Code behind:
=[RemoteNumberHours]*[RemotePCS]

This should work, but it is giving me a total of 1 instead of 0.25. What am
I doing wrong?
Thanks
Linda
From: Rich K on
Looks to me like the code behind ought to be
[RemoteNumberHours]*[NumberPCS]

"LRay67" wrote:

> I have a form that has two fields that are not calculating right.
>
> [RemoteNumberHours] = 0.25
> [NumberPCS] = 1
>
> Code behind:
> =[RemoteNumberHours]*[RemotePCS]
>
> This should work, but it is giving me a total of 1 instead of 0.25. What am
> I doing wrong?
> Thanks
> Linda
From: Dennis on
The destination variable is an Integer type. Make it a Double or Float.

"LRay67" wrote:

> I have a form that has two fields that are not calculating right.
>
> [RemoteNumberHours] = 0.25
> [NumberPCS] = 1
>
> Code behind:
> =[RemoteNumberHours]*[RemotePCS]
>
> This should work, but it is giving me a total of 1 instead of 0.25. What am
> I doing wrong?
> Thanks
> Linda
From: Marshall Barton on
LRay67 wrote:

>I have a form that has two fields that are not calculating right.
>
>[RemoteNumberHours] = 0.25
>[NumberPCS] = 1
>
>Code behind:
>=[RemoteNumberHours]*[RemotePCS]
>
>This should work, but it is giving me a total of 1 instead of 0.25.

I don't think that's possible unless there is something else
getting in the way. If RemoteNumberHours and NumberPCS are
fields in the form's record source table/query and
=[RemoteNumberHours]*[RemotePCS]is a text box control's
control source, I would expect the result .25 to be
displayed (0 if the text box's Format does not allow any
decimal places).

Or, maybe you are using the word "field" for different
things and you have some VBA code doing something odd.

--
Marsh
MVP [MS Access]