E
ernief
Guest
I have put the following code in the OnKeyPress event of a text box txtProgramDate
Private Sub txtProgramDate_KeyPress(KeyAscii As Integer)
If KeyAscii = 43 Or KeyAscii = 45 Then
If KeyAscii = 43 Then
txtProgramDate.Value = txtProgramDate.Value + 1
Else
txtProgramDate.Value = txtProgramDate.Value - 1
End If
End If
Me.Form.Refresh
End Sub
This increments that date fine but the + or - symbol remains in the box until the text box loses focus. I would really like the amended date to be refreshed as soon as the + or - key is pressed.
The line M.Form.Refresh does not seem to make any difference.
Thanks in anticipation
Private Sub txtProgramDate_KeyPress(KeyAscii As Integer)
If KeyAscii = 43 Or KeyAscii = 45 Then
If KeyAscii = 43 Then
txtProgramDate.Value = txtProgramDate.Value + 1
Else
txtProgramDate.Value = txtProgramDate.Value - 1
End If
End If
Me.Form.Refresh
End Sub
This increments that date fine but the + or - symbol remains in the box until the text box loses focus. I would really like the amended date to be refreshed as soon as the + or - key is pressed.
The line M.Form.Refresh does not seem to make any difference.
Thanks in anticipation