Open report or dataport with a "default" filter

Hi How do I create the function that transfers the the value from the current form (eg. Doc No.) to the filter field on a report or a dataport when I open it from the form? Is it a property or does it need to be coded? Example: Looking at an invoice (form) and push the print button, the invoice no. will automatically be transferred to the req. filter field on the invoice report. Regards Karl

I’m not sure I understand what you want, but I guess this code will work: CurrForm.SETSELECTIONFILTER(MyRecordVariable); REPORT.RUNMODAL(REPORT::“My Report”,TRUE,FALSE,MyRecordVariable);