When Key Press =,+, - is pushed in textbox puts currentdate, adds 1 day, subtracts 1 day
This code is a input feature that shows how to take a keypress on a textbox and either add, subtract or set current date. + key will add 1 day, - will subtract ond day, and = sets current date. This helps with getting dates from users.
AI
AI Summary: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Source Code
Private Sub Form_Load()
Text1 = Date
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
Select Case KeyAscii
Case Is = 61
KeyAscii = 0
Text1 = Date
Case Is = 43
KeyAscii = 0
If Text1 = "" Then
Text1 = DateAdd("d", 1, Date)
Else
Text1 = DateAdd("d", 1, Text1)
End If
Case Is = 45
KeyAscii = 0
If Text1 = "" Then
Text1 = DateAdd("d", -1, Date)
Else
Text1 = DateAdd("d", -1, Text1)
End If
End Select
End Sub
Original Comments (3)
Recovered from Wayback Machine