Last post Dec 08, 2008 01:50 AM by ASP.NET Dev
Dec 03, 2008 03:43 PM|skw1966|LINK
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?
Dec 03, 2008 04:40 PM|RussSolberg|LINK
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();
Dec 07, 2008 06:19 PM|GabrielS_EUK|LINK
where do you want to set the date as default, in MSAccess database or in scripts ?
Dec 08, 2008 01:50 AM|ASP.NET Dev|LINK
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]