MackMan
Registered User.
- Local time
- Today, 12:57
- Joined
- Nov 25, 2014
- Messages
- 174
I have a date field, that can be changed via "+/-" keys on the numeric key pad by increments of either plus or minus one day.
Because data within the field physically wont change by typing a new value, is there any way of forcing the before update event to fire if it's changed?
Am I right in thinking the only way to do so, would be to use VBA to copy the new value, and paste within itself (if that makes any sense) thus firing a dirty event for that date field.
I've been racking my brain for a couple of days on this one, and still cant get it to work.
As always, any advice appreciated.
Thank you
Code I'm using for the +/- keys (if it helps) is...
Because data within the field physically wont change by typing a new value, is there any way of forcing the before update event to fire if it's changed?
Am I right in thinking the only way to do so, would be to use VBA to copy the new value, and paste within itself (if that makes any sense) thus firing a dirty event for that date field.
I've been racking my brain for a couple of days on this one, and still cant get it to work.
As always, any advice appreciated.
Thank you
Code I'm using for the +/- keys (if it helps) is...
Code:
Private Sub TransDate_KeyDown(KeyCode As Integer, Shift As Integer)
If Not IsNull(Me.TransDate) Then
If KeyCode = 107 Then
Me.TransDate = Me.TransDate + 1
KeyCode = 0
ElseIf KeyCode = 109 Then
Me.TransDate = Me.TransDate - 1
KeyCode = 0
End If
ElseIf IsNull(Me.TransDate) Then
If KeyCode = 107 or KeyCode = 109 Then
Me.TransDate = Date
KeyCode = 0
End If
End If
End Sub