Standardizing Date Fields

J

JWeaver

Right now, a user enters a date along with the day of the week, i.e., 6/13/08
Fri, into a StartDate field. The field is set up as a text field. Is it
possible to convert the text field that holds date information into a date
field so that the information is still displayed as above with the date
followed by the first 3 letters of the day of the week? Some users may enter
the date as 06/13/08 while others enter it as 6/13/08. This causes sort
problems since this is a text field.

Your help is appreciated!!
 
R

ruralguy via AccessMonster.com

You would be miles ahead of the game if your fields were DateTime fields.
The Format() function would allow you to display that DateTime field in
almost any way you might want. Have you considered using a Date Picker for
entering your date? Jeff Conrad has listed a few to pick from that are *not*
ActiveX based.
http://www.accessmvp.com/JConrad/accessjunkie/calendars.html
 
L

Linq Adams via AccessMonster.com

Allan's advice is sound, but I guess it depends on exactly how you plan to
use this field. If you're never going to manipulate the date in any way, i.e.
if you're never going to sort by it, pull records using it, or calculate
future dates based on it, you could leave it a text field and use the
AfterUpdate event of the field to add the three letter designation for the
day of the week:

Private Sub YourPseudoDateField_AfterUpdate()
Me.YourPseudoDateField = YourPseudoDateField & Format(YourPseudoDateField, "
ddd")
End Sub
 
Top