Subject Re: Data module with a complex index
From Akshat Kapoor <akshat.kapoor@kapoorsons.in>
Date Sat, 7 Dec 2019 17:53:13 +0530
Newsgroups dbase.getting-started

On 07-12-2019 17:09, Robbie Nott wrote:
> Hi Akshat
>
> Thanks you very much for the information.
>
> I was hoping to have all the query and table code in one place.
> If I have to do stuff in the form to manipulate the
> data module then it kind of defeats the purpose...
>
> Your assistance is greatly appreciated
> Greetings from wet and rainy Johannesburg
>
> :-)
>

Editing of Datamodules is hardly required.
In fact I open the datamodules in source editor only when I want to view
the query for some reason.

For Most uses setting the value of params in forms and then requey() is
sufficient.

And at times the same datamodule is used in multiple places (Form and
Report generally use the same datamodule).


A typical print routine that I use to print invoices.

    function PRINT_onClick()
       set procedure to p_tax.rep
       r = new p_taxreport()
       r.taxdatamodule1.tax2.params["invoice"].value = str(minvoice,10,0)
       r.taxdatamodule1.tax2.requery()
       if r.printer.chooseprinter()
          r.title = "Tax Invoice No. (Original)"+ minvoice
          r.render()
       endif
       close procedure p_tax.rep
       form.footer.add.setfocus()
       return


Regards
Akshat