Entering a date format

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello,

Thanks for all the help so far. I have a form with a standard date field in
it. What I want to do is creat a data entry situation where when I tab into
the field I can use the arrow up or down to control the date that I see. If I
arrow up then it will give me the previous date and now being the next.

Joe C
Big Papi
 
Would + and - do for incrementing/decrementing the date value?

See:
Rolling dates by pressing "+" or "-"
at:
http://allenbrowne.com/ser-02.html

If you want to use the up/down arrows instead, you would need to use the
KeyDown event of the control, and read KeyCode instead of KeyAscii.
 
Not sure if that what you mean, but you can use the KeyDown event of the text
box to control the key down number to capture the arrow.

Private Sub DateField_KeyDown(KeyCode As Integer, Shift As Integer)
If IsNull(DateField) Then Exit Sub
If KeyCode = 38 Then
Me.DateField = Me.DateField + 1
KeyCode = 0
Else
If KeyCode = 40 Then
Me.DateField = Me.DateField - 1
KeyCode = 0
End If
End If
End Sub
 
Folks,

Thanks for the help. before I read the link provided, how does this field
get populated with a calendar? Will it know to go to the next date because of
the date field?

Joe C
 
Back
Top