What I need is that end user is able to filter data by selecting drop down calendar from Date field. Trying to find a solution, with a help from OO Forum i did the following code and it works well
Code: Select all
Sub filter_by_date
Dim oFormCtl As object
Dim strFilter As string
Dim oFilter As Object
oFormCtl = ThisComponent.Drawpage.Forms.getByName("MainForm")
oFilter = oFormCtl.getByName("DateField")
if oFilter.Text <> "" then
oFormCtl.Filter="date = {D '2007-10-10'}"
oFormCtl.ApplyFilter = True
else
oFormCtl.ApplyFilter = False
end if
oFormCtl.Reload
End Sub
Code: Select all
strFilter="date = {D '" & oFilter.Text & "'}"
oFormCtl.Filter=strFilter
when the form is loading, and afterwards nothing is happening no matter what date is selected in Datefield.SQL Status: 37000
Error code: -16
Wrong data type: java.lang.IllegalArgumentException in statement [SELECT * FROM "Table1" WHERE "date" = '2007.10.10' ]
It becomes really frustrating and I would be very grateful for help.
Vanja