Passing Parms

M

Mark

Hello,

Is there a better way to pass parm's from one form to another? Right now
all I can think to do is a dlookup once the second form is called back to the
first form.

I have a 4 button's on form A that will open form B. Form B has date picker
and a few other options they can select. I don't want to have to create four
different forms (B), so I want to pass the report's name to form B.

Is there anything better then creating a hidden txt field on Form A then
doing a dlookup form form B to get this info?

Can you pass parm' via

docmd.openform
 
J

John Nurick

Hi Mark,

DoCmd.OpenForm has an OpenArgs argument, and anything you pass to that
is available as the OpenArgs property of the form you're opening.

Using a hidden textbox on the calling form is also a standard technique,
but normally you don't need to use DLookup to retrieve its contents.
From the other form, just use something like
Forms("Calling Form").Controls("txtXXX").Value
or
Forms![Calling Form]!txtXXX
 
Top