Results 1 to 2 of 2
Thread: Calculations in textbox (2002)
2004-11-23, 12:36 #1
- Join Date
- Feb 2003
- Thanked 0 Times in 0 Posts
Calculations in textbox (2002)
Trying to do a calculation based on a checkbox. Have two questions.
Trying to write code that will subtract .1 from a number in one textbox and place the result in another textbox. Here is the code. Problem is it won't subtract. If I multiple or divide it it works.
If Me.chkTournEligible = -1 Then
Me.TournEligibleScore = Me.txtScore -.1
ElseIf Me.chkTournEligible = 0 Then
Me.TournEligibleScore = 0
Second question is how do I get the textbox where I want the result to show up to show the answer to one decimal place (78.9) I can get the box to show one decimal place but it only shows 78.0. Is there a textbox property I am not setting or do I have to do something in the above code to get it the way I want it?
2004-11-23, 12:52 #2
- Join Date
- Jun 2002
- Mt Macedon, Victoria, Australia
- Thanked 45 Times in 44 Posts
Re: Calculations in textbox (2002)
Is TournEligibleScore bound to a field in a table? If so what data type is it?
It looks to me like you are using an integer data type, which only accepts whole numbers. Change the data type to single to accept decimals.
The field is still a number, but you need to use the properties of the field to say what type.Regards