[Solved] Filter subForm by date

Creating and using forms
Post Reply
te4o93
Posts: 2
Joined: Fri Apr 29, 2016 12:51 am

[Solved] Filter subForm by date

Post by te4o93 »

hello everybody, i need help to filter a subForm by date parameter
it doesn't get any error but for every date i try to set it clears the subForm
this is what i'm trying to do
(my date format(italian) is DD/MM/YY)

Code: Select all

   dim oFilter as object

	oForm = ThisComponent.DrawPage.Forms.getByIndex(0)
	oSubForm = oForm.GetByName("SubForm")  
	
	oSubForm.Filter = "'Date' >= '20/03/16'"
	oSubForm.ApplyFilter = True
	
	oSubForm.Reload 
End Sub
Thanks
Last edited by Hagar Delest on Sat Apr 30, 2016 9:48 pm, edited 2 times in total.
Reason: tagged [Solved].
OpenOffice 4 on Windows 10
User avatar
Villeroy
Volunteer
Posts: 31279
Joined: Mon Oct 08, 2007 1:35 am
Location: Germany

Re: Filter suForm by date

Post by Villeroy »

'20/03/16' is not a date.
'2016-03-20' is a date.
Please, edit this topic's initial post and add "[Solved]" to the subject line if your problem has been solved.
Ubuntu 18.04 with LibreOffice 6.0, latest OpenOffice and LibreOffice
te4o93
Posts: 2
Joined: Fri Apr 29, 2016 12:51 am

Re: Filter suForm by date

Post by te4o93 »

thanks i fixed it with this --> {d 'yyy-mm-dd'}
OpenOffice 4 on Windows 10
Post Reply