Looking for some FYI

  • Thread starter Thread starter Rowland
  • Start date Start date
R

Rowland

Is it considered more elegant to pass Variables between
forms using hidden text fields, or using a global
veriable.

I know how to do it both ways, but what way is "better"

thanks Rowland
 
Both ways suffer from similar problems. Forms have to 'know' the name of
the global variable, or the name of the textbox on the other form, so you
lose the advantages of modular coding and portability.

If you can, an 'elegant' way is to use the openargs property to pass
variables, even if you have to string some together with delimiters.

One problem with global variables is that you lose the values if your code
encounters an unhandled error. At least hidden form textboxes preserve the
value, at the expense of more controls on the form.

--
Regards,

Adrian Jansen
J & K MicroSystems
Microcomputer solutions for industrial control
 
Rowland said:
Is it considered more elegant to pass Variables between
forms using hidden text fields, or using a global
veriable.

I know how to do it both ways, but what way is "better"


Neither one is particularly elegant. But using controls on
a form has the advantage of not being reset by an unhandled
error.

For simple arguments, OpenArgs is more elgant.

Far more complex (and not necessarily more elegant) is to
use a custom collection or even a purpose-buitl class
module.
 
Oh how excellent, I never actually knew what that
OpenArgs was for on the openform command.

now that I due I think I will be implimenting it in the
second version. I am to far into this one to redo it all.

Thanks for the heads up you guys.
 
Back
Top