Using OpnArgs method

  • Thread starter Thread starter rudwan
  • Start date Start date
R

rudwan

when we need to open another form , and to transfer one
value from the current form to the new form , we use
openargs method
this for example , transfer the value of ( empid ) , to be
used in the form which i want to open it .
but suppose i need to use more values of more than one
control , for example , i want the code to remember
another value , like transactionID , is there any way to
remember it ?
 
when we need to open another form , and to transfer one
value from the current form to the new form , we use
openargs method
this for example , transfer the value of ( empid ) , to be
used in the form which i want to open it .
but suppose i need to use more values of more than one
control , for example , i want the code to remember
another value , like transactionID , is there any way to
remember it ?

Using the OpenArgs argument, you could pass a "delimited" string (use a
character, such as a comma or tilde to separate the multiple values) and, from
within the called form, parse out the values from the string. If you are using
Access 2000 or later, you can use the "Split()" function to do that, otherwise
you will need to write your own function or procedure to do the parsing.

You could also use global variables to store the values prior to opening the
second form. Using global variables, you are also able to pass values back to
any other part of your application. Global variables must be declared in a
standard module (a global module, not one behind a form or report).
 
On my website (see sig below) is a small sample database called
"OpenArgs.mdb" which illustrates how to do this.
 
Back
Top