Passing Data from one form to another.

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Greetings;

Ok, it's not exactly passing from one form to another, but close enough.

What is happening, is the Client clicks on "a" button, and is asked a
question. I want to pass that Value, to the form that opens after the Client
confirms the value is correct.

Example.

Pop up : Please enter the Client's Name : John Smith <enter>

Form Opens.

What I'm using is the DoCmd.OpenForm method to open the Form I want after
the Data requested was opened.

In the OpenForm Command it asks for a Condition. I use this as my Condition :

Form!OpenThis!TextBox.Value = Client_Name

Now, I realize this should probably go into the OpenArg's spot... but have
yet to try it.

I do get the error of 'OpenThis' can't be found. Now, if I took that
Condition out, it opens the form perfectly fine.

Any thoughts would be apriciated.

Sincerely;
~Lethoric De'clree
 
why not make the first form invisible after pressing the
button that calls the second form. The second form can
retrieve the data from any of the controls on the first
form quite easily. When finished retrieving the info
needed, close the first form.

Example:

Docmd.openform "frm_First",,,acdialog (waits until form
is either invisible or closed to move to next line of
code)
if IsLoaded("frm_First") then 'Test if first form is
open and if closed do not open second form... allows for
cancel button which closes form
docmd.openform "frm_Second"
end if

In Form_Open of second form make your controls or
variables equal to the values from the first form and
then close the first form.
 
Back
Top