R
rolaaus
I saw the following code segment in reference to changing a field value
depending on whether + or - was pressed.
Select Case KeyAscii
Case 43 ' Plus key
KeyAscii = 0
Screen.ActiveControl = Screen.ActiveControl + 1
Case 45 ' Minus key
KeyAscii = 0
Screen.ActiveControl = Screen.ActiveControl - 1
End Select
My question is I have a field that may or may not have fractions, and I want
the + or - to change the fraction only. Is there a function or some way to
evaluate the fraction portion of the value of a field?
I will probably have to end up using a select case to determine what the
fraction is, then use the above code to change the fraction up or down, but I
don't know how to determine if the field has a fraction.
select case fraction(me.txtFieldName)
case .25
Select Case KeyAscii
Case 43 ' Plus key
KeyAscii = 0
Screen.ActiveControl = Screen.ActiveControl + .25
Case 45 ' Minus key
KeyAscii = 0
Screen.ActiveControl = Screen.ActiveControl - .25
End Select
end select
depending on whether + or - was pressed.
Select Case KeyAscii
Case 43 ' Plus key
KeyAscii = 0
Screen.ActiveControl = Screen.ActiveControl + 1
Case 45 ' Minus key
KeyAscii = 0
Screen.ActiveControl = Screen.ActiveControl - 1
End Select
My question is I have a field that may or may not have fractions, and I want
the + or - to change the fraction only. Is there a function or some way to
evaluate the fraction portion of the value of a field?
I will probably have to end up using a select case to determine what the
fraction is, then use the above code to change the fraction up or down, but I
don't know how to determine if the field has a fraction.
select case fraction(me.txtFieldName)
case .25
Select Case KeyAscii
Case 43 ' Plus key
KeyAscii = 0
Screen.ActiveControl = Screen.ActiveControl + .25
Case 45 ' Minus key
KeyAscii = 0
Screen.ActiveControl = Screen.ActiveControl - .25
End Select
end select