locked
Default date in date field RRS feed

  • Question

  • User1949719037 posted

    I have an .aspx file with an input form linked to an MS Access database.  The date field receives a value of yesterday's date except for Monday which will have input for Friday, Saturday and Sunday.

    I'd like to have a default date of yesterday in the date field but also the ability to change it. 

    Is there a place in the properties to set the default date or must it be done in the code?

    Wednesday, December 3, 2008 3:43 PM

Answers

  • User1817007508 posted

    Hi,

    Follow these steps,

    -> Open your access database
    -> locate table
    -> right click and select design view
    -> Click column "yesterday"
    -> Local the "general" tab below columns list
    -> Locate and click "Default Value"
    -> Type Now()

    All the best [Yes]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 8, 2008 1:50 AM

All replies

  • User323304077 posted

    I'm not sure about the property, but you could certainly have it set in the code behind like this on page_load...

    this.txtDateBox.text = DateTime.Now.AddDays(-1).ToShortDateAsString();

    Wednesday, December 3, 2008 4:40 PM
  • User-1303344770 posted

    Hi kw1966,

    where do you want to set the date as default, in MSAccess database or in scripts ?

    Sunday, December 7, 2008 6:19 PM
  • User1817007508 posted

    Hi,

    Follow these steps,

    -> Open your access database
    -> locate table
    -> right click and select design view
    -> Click column "yesterday"
    -> Local the "general" tab below columns list
    -> Locate and click "Default Value"
    -> Type Now()

    All the best [Yes]

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, December 8, 2008 1:50 AM