A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Entry of Dates question



 
 
Thread Tools Display Modes
  #1  
Old February 8th, 2008, 08:11 PM posted to microsoft.public.access.forms
Becky
external usenet poster
 
Posts: 230
Default Entry of Dates question

hello

This is a newbie question, but here goes. My form has a combobox in the
header (cboYear) where the user selects a year, say 2007. The detail section
of the form then shows customer records in a continuous form.

One of the fields is txtDate. I'd like the user to just enter, say, 11/6
and have the date November 6, 2007 stored in the underlying table for later
use in reports. The user currently spends a long time keying in dates or
selecting from a calendar. It would go much quicker if she could just enter,
for example, 11/6 12/31 1/9 etc. on the numeric keypad to get Nov 6, 2007
Dec 31, 2007 Jan 9, 2007 etc.

What's a good way to do this?

Much thanks
Becky
  #2  
Old February 9th, 2008, 03:22 AM posted to microsoft.public.access.forms
Steve Sanford
external usenet poster
 
Posts: 190
Default Entry of Dates question

What data type is the field in your table? Text or Date/Time?


--
Steve S
--------------------------------
"Veni, Vidi, Velcro"
(I came; I saw; I stuck around.)


"Becky" wrote:

hello

This is a newbie question, but here goes. My form has a combobox in the
header (cboYear) where the user selects a year, say 2007. The detail section
of the form then shows customer records in a continuous form.

One of the fields is txtDate. I'd like the user to just enter, say, 11/6
and have the date November 6, 2007 stored in the underlying table for later
use in reports. The user currently spends a long time keying in dates or
selecting from a calendar. It would go much quicker if she could just enter,
for example, 11/6 12/31 1/9 etc. on the numeric keypad to get Nov 6, 2007
Dec 31, 2007 Jan 9, 2007 etc.

What's a good way to do this?

Much thanks
Becky

  #3  
Old February 9th, 2008, 03:39 AM posted to microsoft.public.access.forms
Allen Browne
external usenet poster
 
Posts: 11,706
Default Entry of Dates question

Use the AfterUpdate event procedure of the text box to correct the year if
it differs from the filter combo.

This kind of thing:

Private Sub txtDate_AfterUpate()
If Year(Me.txtDate) Me.cboYear
Me.txtDate = DateSerial(Me.cboYear, Month(Me.txtDate),
Day(Me.txtDate))
End If
End Sub

Note that swapping years like that could cause abberations for Feb 29.

--
Allen Browne - Microsoft MVP. Perth, Western Australia
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.

"Becky" wrote in message
...
hello

This is a newbie question, but here goes. My form has a combobox in the
header (cboYear) where the user selects a year, say 2007. The detail
section
of the form then shows customer records in a continuous form.

One of the fields is txtDate. I'd like the user to just enter, say, 11/6
and have the date November 6, 2007 stored in the underlying table for
later
use in reports. The user currently spends a long time keying in dates or
selecting from a calendar. It would go much quicker if she could just
enter,
for example, 11/6 12/31 1/9 etc. on the numeric keypad to get Nov 6,
2007
Dec 31, 2007 Jan 9, 2007 etc.

What's a good way to do this?

Much thanks
Becky


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:10 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.