Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsFormsForms ProgrammingQueriesModules / DAO / VBAReports / PrintingMacrosDatabase DesignSecurityConversionImporting / LinkingSQL Server / ADPMultiuser / NetworkingReplicationSetup / ConfigurationDeveloper ToolkitsActiveX ControlsNew UsersGeneral 1General 2
Access DirectoryToolsTutorialsUser Groups
Related Topics
SQL ServerOther DB ProductsMS OfficeMore Topics ...

MS Access Forum / Forms / February 2008

Tip: Looking for answers? Try searching our database.

Entry of Dates question

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Becky - 08 Feb 2008 20:11 GMT
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
Steve Sanford - 09 Feb 2008 03:22 GMT
What data type is the field in your table? Text or Date/Time?

Signature

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

> hello
>
[quoted text clipped - 13 lines]
> Much thanks
> Becky
Allen Browne - 09 Feb 2008 03:39 GMT
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.

Signature

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.

> hello
>
[quoted text clipped - 17 lines]
> Much thanks
> Becky
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.