470,600 Members | 1,466 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,600 developers. It's quick & easy.

Access: Option group converts to integer

I am using the value of an optiongroup to dosome calculations and
display in a text box. When I use an option value say 3 and multiply
it by 1.5, the result I get is 4 and not 4.5. I know this sounds
trivial but I have spent quite a bit of time on this and just cannot
figure it out. Please help.
Nov 12 '05 #1
4 2446
"Ranga" <ra************@yahoo.com> wrote in message
news:29**************************@posting.google.c om...
I am using the value of an optiongroup to dosome calculations and
display in a text box. When I use an option value say 3 and multiply
it by 1.5, the result I get is 4 and not 4.5. I know this sounds
trivial but I have spent quite a bit of time on this and just cannot
figure it out. Please help.


Sounds like some implicit conversion to Integer or Long is going on. First
verfy whether this is a math/datatype issue or a display issue What value do
you see if you output the result to the debug window? What is the Format
property setting of the text box? Post the code if you need more help.
Nov 12 '05 #2
Yes, most likely an implicit conversion to integer is taking place. This
is a datatype issue. I see the value without the decimal even when i
output the result to a debug window. There is NO format setting for the
text box. The code as such is very simple.

Private Sub Frame453_Click()
walk_100_slow_x.Value = Frame453.Value * 1.5
End Sub


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 12 '05 #3
"Ranganath Gowda" <ra************@yahoo.com> wrote in message
news:40*********************@news.frii.net...
Yes, most likely an implicit conversion to integer is taking place. This
is a datatype issue. I see the value without the decimal even when i
output the result to a debug window. There is NO format setting for the
text box. The code as such is very simple.

Private Sub Frame453_Click()
walk_100_slow_x.Value = Frame453.Value * 1.5
End Sub


This isn't the bahaviour I get. Is the frame or the text box bound to an
underlying column? Other than that I don't know what the problem could be.
Nov 12 '05 #4
Ranga wrote:
I am using the value of an optiongroup to dosome calculations and
display in a text box. When I use an option value say 3 and multiply
it by 1.5, the result I get is 4 and not 4.5. I know this sounds
trivial but I have spent quite a bit of time on this and just cannot
figure it out. Please help.


Are you talking about display or calculations. If display, change the
format of the field to fixed, decimals 1.

I just created an option group. In the afterupdate event my code is
Private Sub Frame0_Click()
MsgBox Frame0 * 1.5
End Sub
and the message is 1.5, 3, and 4.5 for the numbers 1,2,3.
Nov 12 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.

By using this site, you agree to our Privacy Policy and Terms of Use.