wiklendt
i recommend chocolate
- Local time
- Tomorrow, 01:28
- Joined
- Mar 10, 2008
- Messages
- 1,746
Hi, i've got a form where users can convert centimeters into "Hands high" (a horse database).
so, for 172 cm, the result is 16 Hh and 3 inches (which is then concatenated into a 'result' texbox to "16.3" hands high).
1 hand = 4 inches, so there's no such thing as 16.4 hands, because that's just 17.0 Hands.
however: when i put these calculations into excel (just using cells intead of textboxes), 172 = 16.3 hands, but in access, 172 = 16.0 hands??
the calculation (each step i have in a different textbox on the form) goes like this:
in access:
in excel cells (see attached image):
so:
166 cm = 16.1 Hh (both access and excel)
167 cm = 16.2 Hh (both access and excel)
168 cm = 16.2 Hh (both access and excel)
169 cm = 16.2 Hh (both access and excel)
170 cm = 16.3 Hh (both access and excel)
171 cm = 16.3 Hh (both access and excel)
172 cm = 16.0 Hh (access, incorrect) or (edit) 16.3 Hh (excel, correct)
173 cm = 17.0 Hh (both access and excel)
174 cm = 17.1 Hh (both access and excel)
am i doing something wrong?? Mod in access help, is, predictably, no help at all. the calculation in access fails on every 'cusp' (i.e., seems to calc the remainder (mod) fine, but not increment the whole integer....)
so, for 172 cm, the result is 16 Hh and 3 inches (which is then concatenated into a 'result' texbox to "16.3" hands high).
1 hand = 4 inches, so there's no such thing as 16.4 hands, because that's just 17.0 Hands.
however: when i put these calculations into excel (just using cells intead of textboxes), 172 = 16.3 hands, but in access, 172 = 16.0 hands??
the calculation (each step i have in a different textbox on the form) goes like this:
in access:
Code:
txtCentimetres = user input value
txtInches =[txtCentimetres]*0.393700787
txtHands =Int([txtInches]/4)
txtInchesMod4 =[txtInches] Mod 4
txtHh =[txtHands] & "." & [txtInchesMod4]
in excel cells (see attached image):
Code:
cell B2 = user input centimeter value
cell B3 =B2*0.393700787
cell B4 =INT(B3/4)
cell B5 =INT(MOD(B3,4))
cell B6 =B4 & "." & B5
so:
166 cm = 16.1 Hh (both access and excel)
167 cm = 16.2 Hh (both access and excel)
168 cm = 16.2 Hh (both access and excel)
169 cm = 16.2 Hh (both access and excel)
170 cm = 16.3 Hh (both access and excel)
171 cm = 16.3 Hh (both access and excel)
172 cm = 16.0 Hh (access, incorrect) or (edit) 16.3 Hh (excel, correct)
173 cm = 17.0 Hh (both access and excel)
174 cm = 17.1 Hh (both access and excel)
am i doing something wrong?? Mod in access help, is, predictably, no help at all. the calculation in access fails on every 'cusp' (i.e., seems to calc the remainder (mod) fine, but not increment the whole integer....)
Attachments
Last edited: