Ferry Toth wrote:
OK solved one problem: there appear to be at least 3 date types:
1) the UNO date type (struct of 3 unsigned)
2) OO Basic date type (float)
3) the date type (unsigned long)
Fixed the below code by converting using Conv_Date (trivial code)
The parameter gets set and functions.
Big problem emerges: the Parameter Input dialog box still appears! It goes
away when I switch of Analyze Query (or so, I have the Dutch version), but
then my parameter doesn't get filled in as well, and I get an error.
Am I really making things too difficult? All I want to do is have 2 controls
on the form StartDate and EndDate and not have the user breaking the code
when he adds a filter by pressing the filter button and not have the
Parameter Input dialog appearing.
Please help...
Ferry
> Hello Drew,
>
> If I understand it correctly, I can use SingleSelectQueryAnalyzer to
> figure out the parameter index after I get the following working:
>
> oDoc = thiscomponent
> oForm = oDoc.DrawPage.Forms(0)
> REM oForm.ActiveCommand contains select * from trackdata where
> ("StartDate"
>> ?)
> REM Enumerate forms and controls.
> For i = 0 To oform.getCount()-1
> x = oForm.getByIndex(i)
>
> REM find out if it is a data aware control
> If x.supportsService("com.sun.star.form.DataAwareControlModel") Then
> REM check if this is an unbound control
> If x.DataField = "" then
> if x.Name = "StartDate" then oForm.setDate(1, x.CurrentValue)
> End if
> End if
> Next
> oForm.reload
> End Sub
>
> Unfortunately I get an error with setDate (parameter not set). If I use
> setObject there is no error, but I still get the Parameter Input dialog
> box.
>
> Do you know what's wrong here?
>
> Ferry
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]