Hi,
How do I change the date format on a report form?
It currently prints our in US format but I need it in UK format.
Thanks
Dave
I've been trying to find the code that we used to do this, but I wanted to at least give you some guidance on how it was done. We created a new property that is a CHAR field and then use a SQL statement to change the format into how we wanted it to show for UK format. If I find the code the date formatting I will send it over.
You can also use form script on StdObjectSelectCurrentComplete to update the date. The script below gets the date from the property, changes the format, and sets the component value but you could also set the property value if you prefer.
Sub SetDate() Dim DateFormat as string = "dd/MM/yyyy" Dim ServiceDate as Date Dim sServiceDate as String 'ServiceDate convert ServiceDate = CDate(ThisForm.PrimaryIDOCollection.GetCurrentObjectProperty("ue_SvcDate")) sServiceDate = ServiceDate.ToString(DateFormat) ThisForm.Components("ServiceDateGroupHeaderEdit_SITE").SetValue(sServiceDate)End Sub