The real question here is why do you need to transfer the data?
Further, if the form is open, then why not just use a reference to that
form?
In other words, it is FAR better to reference values in a form, then trying
to TRANSFER them.
For example, lets assume formA has to open formB.
Lets also assume that formB needs a bunch of values from formA
In place of transferring a bunch of values, it is far easier to simply use a
reference to that first form.
So, in the formsB on-open (and, in fact we can even use a event as late as
the on-load), we can grab a reference to the previous form.
In form B's module code we go:
Option Compare Database
Option Explicit
Dim frmP As Form ' prevous form
Then, in the forms on-load we now go:
set frmP = Screen.ActiveForm
So, now our form B has a ref to the previous form. To grab the key id, we
can go:
msgbox "value of form A key id = " & frmP!ID
We can also force form A to write its data to disk (say, we are about to do
some operation that needs this data for a report in form B), We can now go:
frmP.Refresh
And, any other value we need can be used.
msgbox "The company name is " & frmP!CompanyName
So, you see, why transfer the data, when you can use a reference tot he
previous form. This takes no global vars, you can grab ANY value from the
form, and further, you can also reference all of the forms properties and
events to do things like writing data to disk!
So, my answer is don't transfer data..but use a reference, and leave the
data where it belongs.
Perhaps your question is NOT in regards to data entry form, but how can one
make some prompt forms, and dialog forms that RETURNS values to a calling
form?
While the above form ref is about the best approach in ms-access to TRANSFER
things, if you need a form to RETURN values, and wrap it in a function (say,
a nice date prompt form), then you can read the following article of mine
that shows how to have a form return values, and NOT have to use global
vars:
http://www.attcanada.net/~kallal.msn/Dialog/Index.html