Results 1 to 2 of 2
  1. #1
    2 Star Lounger
    Join Date
    Feb 2002
    Location
    Chicago
    Posts
    110
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Easy Date Formatting Question (xp)

    I need to enter and view dates in a field by month and year only. How can I type in and see, for example, 03/04?

    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Easy Date Formatting Question (xp)

    Access, or rather Windows, won't allow you to enter a date that way. With MDY as standard date order, 01/03 will be interpreted as the 3rd of January of this year, i.e. 01/03/3004, not as January 2003.

    One way to get around it is to enter the date in the form Mar-04; if you set the Format property to mm/yy, it will be displayed as 03/04.
    Another way is to use an unbound text box on a form, and populate the date field in the After Update event of the text box:

    Private Sub txtDateEntry_AfterUpdate
    Me.DateField = DateValue("01/" & Me.txtDateEntry)
    End Sub

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •