G
grep
I had an interesting idea regarding a date field. I want to do a
Quicken-style date change thing... where you can press + or - to change
the date in the field. I figured it would be easy, using the KeyPress
event, but it's not working the way I thought. Here's what I tried:
Private Sub Date_KeyPress(KeyAscii As Integer)
Dim CurrentDate As Date
CurrentDate = Me.Date
Select Case KeyAscii
Case 45 ' ANSI value of -
Me.Date = DateAdd("d", -1, CurrentDate)
Case 43 ' ANSI value of +
Me.Date = DateAdd("d", 1, CurrentDate)
End Select
End Sub
Any thoughts?
grep
Quicken-style date change thing... where you can press + or - to change
the date in the field. I figured it would be easy, using the KeyPress
event, but it's not working the way I thought. Here's what I tried:
Private Sub Date_KeyPress(KeyAscii As Integer)
Dim CurrentDate As Date
CurrentDate = Me.Date
Select Case KeyAscii
Case 45 ' ANSI value of -
Me.Date = DateAdd("d", -1, CurrentDate)
Case 43 ' ANSI value of +
Me.Date = DateAdd("d", 1, CurrentDate)
End Select
End Sub
Any thoughts?
grep