G
grep
I wrote a function which just increments or decrements a field, if you
hit "+" or "-" (a la Quickbooks/Quicken). When I run it in debug, it
works perfectly. When I turn off debug, however, it stops working.
Here's the function:
Public Function PlusMinus(FieldVal As Integer, Key As Integer)
'Increments/Decrements value based on + or - keys
If Key = 43 Then
PlusMinus = FieldVal + 1
ElseIf Key = 45 Then
PlusMinus = FieldVal - 1
Else: PlusMinus = FieldVal
End If
End Function
Here's the call from a field's OnKeypress Event:
Private Sub Grade_KeyPress(KeyAscii As Integer)
'Increment/Decrement Grade
Grade = PlusMinus(Grade, KeyAscii)
End Sub
Any suggestions?
grep
hit "+" or "-" (a la Quickbooks/Quicken). When I run it in debug, it
works perfectly. When I turn off debug, however, it stops working.
Here's the function:
Public Function PlusMinus(FieldVal As Integer, Key As Integer)
'Increments/Decrements value based on + or - keys
If Key = 43 Then
PlusMinus = FieldVal + 1
ElseIf Key = 45 Then
PlusMinus = FieldVal - 1
Else: PlusMinus = FieldVal
End If
End Function
Here's the call from a field's OnKeypress Event:
Private Sub Grade_KeyPress(KeyAscii As Integer)
'Increment/Decrement Grade
Grade = PlusMinus(Grade, KeyAscii)
End Sub
Any suggestions?
grep