Transferrig a parameter to a sub form

classic Classic list List threaded Threaded
2 messages Options
Egbert Eissing Egbert Eissing
Reply | Threaded
Open this post in threaded view
|

Transferrig a parameter to a sub form

 I have a form with atable control which lists all the employees, and a sub-form with atable control that lists the payroll data of each employee.
If an employee isselected in the first table, the employeeID should be passed to thesub form to filter the data for the selected employee. The code couldlook something like this:
 oDoc=ThisComponent.DrawPage.Forms oFormACemplData=oDoc.getByName("ACemplData”) ' main form oFormPayrollData=oDoc.getByName("FormPayrollData”) ' sub form
 oEmployeeID =oForm.getByName("employeeID") ' employeeID is theparameter for TablePayrollData. sEmployeeID =oEmployeeID.text  oFormPayrollData.Parameter= setINT(sEmployeeID) oFormPayrollData.refresh()
It is this second tolast line, the syntax of which I do not know, and have not been ableto find in any of the examples I have read and re-read. Alternatively, if itis not possible to just pass a parameter to the table, may be it ispossible to pass a complete prepared statement instead.
Could anybodyprovide some clue on how to do it?Thanks for helping. Egbert
--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted
Andreas Säger Andreas Säger
Reply | Threaded
Open this post in threaded view
|

Re: Transferrig a parameter to a sub form

Am 15.01.2016 um 04:23 schrieb Egbert Eissing:
>  I have a form with atable control which lists all the employees, and a sub-form with atable control that lists the payroll data of each employee.
> If an employee isselected in the first table, the employeeID should be passed to thesub form to filter the data for the selected employee. The code couldlook something like this:
>  oDoc=ThisComponent.DrawPage.Forms oFormACemplData=oDoc.getByName("ACemplData”) ' main form oFormPayrollData=oDoc.getByName("FormPayrollData”) ' sub form
>  oEmployeeID =oForm.getByName("employeeID") ' employeeID is theparameter for TablePayrollData. sEmployeeID =oEmployeeID.text  oFormPayrollData.Parameter= setINT(sEmployeeID) oFormPayrollData.refresh()
> It is this second tolast line, the syntax of which I do not know, and have not been ableto find in any of the examples I have read and re-read. Alternatively, if itis not possible to just pass a parameter to the table, may be it ispossible to pass a complete prepared statement instead.
> Could anybodyprovide some clue on how to do it?Thanks for helping. Egbert
>

Apply master and slave fields to the subform. No macro required. For
more than A=B AND X=Y bindings, you can bind the subform to a parameter
query and link paramA=X AND paramB=Y while paramA and paramB can be used
with all kinds of functions and operators.


--
To unsubscribe e-mail to: [hidden email]
Problems? http://www.libreoffice.org/get-help/mailing-lists/how-to-unsubscribe/
Posting guidelines + more: http://wiki.documentfoundation.org/Netiquette
List archive: http://listarchives.libreoffice.org/global/users/
All messages sent to this list will be publicly archived and cannot be deleted