Is there a way to set a date field on a smartdbform to be the current date? I know in other programs there is =Now() etc. what would be the correct syntax and where would it go.
This is for an insert form binding a field in a table that is capturing the entry date of the form.
Hi David,
You can set the initial value to be today date by dynamically initializing the corresponding insert parameter's default value to the system current date. In order to do it you should handle the Page Load event and add code which will assign the current date to the insert parameter. To create Page Load handler in design-time double click somewhere on empty space in the page. In the event handler put the following code, just replace the names of data source and parameter:protected void Page_Load(object sender, EventArgs e){ SmartDataSourceSelectedEmpoyee.InsertParameters["HireDate"].DefaultValue = DateTime.Today.ToString();}
In Visual Basic the code will be:Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) SmartDataSource1.InsertParameters("HireDate").DefaultValue = DateTime.Today.ToString()End Sub
If you have any other questions, we will be more than happy to help you.Best wishes,Adillis SupportAdillis - IT solutions http://adillis.com