Why is default value assigned for a Date field not working?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • bryman
    New Member
    • May 2010
    • 1

    #1

    Why is default value assigned for a Date field not working?

    I haven't experienced this problem of assigning Date or Now to a date field's default property so the form shows the current date. Of course, this is to help ease data entry for the user.

    The field "DateOfDete rm" is a Date/Time field. On the form the default property of this field is set to Date. When form opens it does not show current date. Field is formatted as "Short Date".

    Am I missing a setting somewhere? This works in other applications I've completed. I also tried using VBA to assign the value but I get a "cannot assign a value to this object" error

    All help is greatly appreciated!

    Bryman
  • NeoPa
    Recognized Expert Moderator MVP
    • Oct 2006
    • 32669

    #2
    It's hard to know what you're really saying. There is no .Default property. There is a .DefaultValue property. If you try to assign Date to this property it won't work (It's not possible). It converts it automatically to "Date". On the other hand, if you were to assign to it Date(), then it should work.

    I don't know what you've actually done, but if you've done it correctly, and it's not working for you, then something else is wrong that you haven't shared.

    Comment

    • Bryceson Pinto

      #3
      I did use the .DefaultValue property. Sorry for the lack of a meaningful explanation. And I did use the Date() assignment. Don't know what was different with this field because it worked after I deleted the field from the table then added another date field to the table. After setting the .DefaultValue property to Date() it worked!

      Thank you for your help.

      Comment

      • NeoPa
        Recognized Expert Moderator MVP
        • Oct 2006
        • 32669

        #4
        A pleasure. Glad that you managed to get it working :-)

        Comment

        Working...