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. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
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
|
|||
|
|||
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
|
|||
|
|||
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 | |
|
|