Solved

Microsoft Access 2010 How to automatically enter the year when entering day and month in text box

Posted on 2014-03-24
3
599 Views
Last Modified: 2014-03-24
I have a client that wants to streamline data entry for date fields in text boxes. They want to type in the day and month and then press enter to automatically display the current year and complete the date field.
0
Comment
Question by:pabrann
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 120

Assisted Solution

by:Rey Obrero (Capricorn1)
Rey Obrero (Capricorn1) earned 100 total points
ID: 39950602
you can get the current year with

=year(date())
or

=year(now())
0
 
LVL 37

Accepted Solution

by:
PatHartman earned 400 total points
ID: 39950606
This is the default behavior if you do not use input masks.  I never use input masks for dates.  I find them clunky and they require the user to enter the entire date.  They also prevent the use of the date picker.  As long as a field is defined as a date data type, Access will not accept invalid data in the field.

Typing in 3/24 {tab} will result in 3/24/2014 as a date.

I don't like using enter to tab to the next field.  That's probably a hang-up from using a typewriter but {Enter} means new line to any one old enough to remember typing.
0
 

Author Closing Comment

by:pabrann
ID: 39950629
Thank you both very much.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In threads here at EE, each comment has a unique Identifier (ID). It is easy to get the full path for an ID via the right-click context menu. However, we often want to post a short link within a thread rather than the full link. This article shows a…
Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
In Microsoft Access, learn different ways of passing a string value within a string argument. Also learn what a “Type Mis-match” error is about.
In Microsoft Access, when working with VBA, learn some techniques for writing readable and easily maintained code.

688 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question