Entering a date format

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
 
A

Allen Browne

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.
 
G

Guest

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
 
G

Guest

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
 

Ask a Question

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.

Ask a Question

Top