I modified some code I found on, I think, oooForums as below. It is
supposed to filter a form based on the value of a field. In this case
the control on the form is a date field (dropdown=yes), dtDateFilter,
and the field in the underlying table that I am trying to filter on,
startDate, is a date field in the table (and the control on the form is
a date too). I get an error when I try to run this code:
sub onSearchDate( oEv )
dim dtSearch
dim oForm
oForm = oEv.Source.Model.Parent
dtSearch= oForm.getByName( "dtDateFilter" )
oForm.Filter = "startDate = " & "{D '" & dtSearch.text & "' }"
oForm.ApplyFilter = True
oForm.Reload
end sub
The error (assuming I choose July 30, 2006 from dtDateFilter):
OpenOffice.org Base
The data content could not be updated
Wrong data type in statement [SELECT * FROM "Appointments" WHERE
"startDate"= '07/30/06' ORDER BY "startDate" ASC, "startTime" ASC,
"endDate" ASC]
oh... did I mention the form is sorted? ;)
As a test, I tried the following line of code:
oForm.Filter = "startDate = " & "{D '" & "2006-07-30" & "' }"
This worked fine!!
Windows 2000 SP 4, OOo 2.0.3
Help is, how do you say, much appreciated. ;) And I will answer any
questions :)
Thanks
WalterAM
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]