how to make a macro convert a date

  • Thread starter Thread starter antaren
  • Start date Start date
A

antaren

I am trying to create a macro that will take a date input
and convert it into MM/DD/YY, for example 01/15/03. The
user would input things like 1/15/03 or 01/15/2003. So
far my macros have no effect on the date.
 
Antaren,

There is no such thing as converting a date. A date in the database
will always be the same, i.e. a number representing the number of days
since 30/12/1899. The only place where the appearance of the date
makes any difference is on forms and reports. In these cases you can
use the Format property of the textboxes to control the way it is
presented. There are some built-in formats such as "short date" etc,
which will reflect how your Windows regional settings are defined.
Otherwise, you can use a custom format, such as "mm/dd/yy" and in any
given case, this is how the date will be shown regardless of how it is
entered.

- Steve Schapel, Microsoft Access MVP
 
Back
Top