I would like to add functionality that would allow the user to press + or - to increment or decrement the date in a field. If I can get this to work, there are a couple of other fields I would like to do the same way so the code needs to sniff the keystroke at the field level. This is what I have so far:
Private Sub txt_presave_date_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 43
txt_presave_date = txt_presave_date + 1
Case 45
txt_presave_date = txt_presave_date - 1
Case Else
KeyAscii = 0
End Select
End Sub
This works except that it first puts the keystroke in the field. For example; pressing + puts a plus sign in the field, if you press the ESC key, the date gets incremented.
How do I get this to NOT put the keystroke in there and just increment the date?
A+, N+, MCP
Private Sub txt_presave_date_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case 43
txt_presave_date = txt_presave_date + 1
Case 45
txt_presave_date = txt_presave_date - 1
Case Else
KeyAscii = 0
End Select
End Sub
This works except that it first puts the keystroke in the field. For example; pressing + puts a plus sign in the field, if you press the ESC key, the date gets incremented.
How do I get this to NOT put the keystroke in there and just increment the date?
A+, N+, MCP