Subject Re: Two Forms - Passing data
From Mervyn Bick <invalid@invalid.invalid>
Date Tue, 21 Oct 2014 22:59:37 +0200
Newsgroups dbase.getting-started

On Tue, 21 Oct 2014 21:48:19 +0200, edward racht <e.racht@gmail.com> wrote:

> I have two forms.
> HS.wfm data form and HSC.wfm lookup form.
>
> I want the entry in the HS.wfm entryfield to be passed to the HSC  
> entryfield when the pushbutton is clicked to open the HSC.wfm lookup  
> form.



In the form's onOpen event handler load HSC.wfm into memory and create an  
instance of it ready for use whenever you need it.  By doing this in the  
form's onOpen event handler it only gets done once.  It can be opened and  
closed as many times as you like later.


   function form_onOpen
      set procedure to HSC.wfm
      form.hsc = new hscform()  //use the actual classname in hsc.wfm
      form.hsc.mdi = false  //needed as HSC.wfm will be opened modally
      form.hsc.parent = this  //necessary if you want the HSC form to write  
back to anything in the HC form.
      return


   function PBC_onClick
      form.hsc.entryfield1.value = form.entryfield1.value //set initial  
value in HSC form
      form.hsc.readModal()
      return.


In HSC.wfm you could use it's onClose event handler to pass values back to  
the parent hc.wfm.

    function form_onClose
       this.parent.whatever.value = this.whatever.value
       return.


Mervyn.