Private Sub YourDateField_KeyPress(KeyAscii As Integer)
If KeyAscii = 43 Then
KeyAscii = 0
Me.YourDateField = Me.YourDateField + 1
ElseIf KeyAscii = 45 Then
KeyAscii = 0
Me.YourDateField = Me.YourDateField - 1
End If
End Sub
Or, for those who don’t like the Date + 1 syntax
Private Sub ExpDate_KeyPress(KeyAscii As Integer)
If KeyAscii = 43 Then
KeyAscii = 0
Me.ExpDate = DateAdd("d", 1, Me.ExpDate)
ElseIf KeyAscii = 45 Then
KeyAscii = 0
Me.ExpDate = DateAdd("d", -1, Me.ExpDate)
End If
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.