How should I approach this?

  • Thread starter Thread starter Lee
  • Start date Start date
L

Lee

Sorry to keep bothering you guys but you've been so
helpful before...

I've got a small form that I've set up with an image and
transparent buttons on for the user to select which label
they would like the addresses to commence printing on.
There are 10 buttons which each correspond to a different
label on a sheet of 2 x 5 labels. This works fine but
I'd like to be able to pass the name of the current
labels report to this form so that I don't have to create
multiple copies of the small form to work with each
labels report. How do I go about doing this? How can I
pass the name of a report from one form to another? Can
you explain the general principles?

Thanks for any help you can give.

Lee
 
-----Original Message-----
Sorry to keep bothering you guys but you've been so
helpful before...

I've got a small form that I've set up with an image and
transparent buttons on for the user to select which label
they would like the addresses to commence printing on.
There are 10 buttons which each correspond to a different
label on a sheet of 2 x 5 labels. This works fine but
I'd like to be able to pass the name of the current
labels report to this form so that I don't have to create
multiple copies of the small form to work with each
labels report. How do I go about doing this? How can I
pass the name of a report from one form to another? Can
you explain the general principles?

Thanks for any help you can give.

Lee
.
Hi Lee,

one way is to use the open arguments property of a form or
report. For example

docmd.openform FormName:="frmPrint", OpenArgs:=me.name

me.name is the saved name of the current form. You could
pass any information, such as a control value or
literals/fixed values (remember to enclose in quotes when
passing text strings). When the form is opened you then
use the information, for example in the opening form
caption.

private sub Form_OnLoad()
if not isnull(me.openargs) then
me.caption=me.openargs
end if
end sub

Luck
Jonathan
 
Thanks for your suggestion Jonathan. I've done what you
suggested and it works just fine.....excellent stuff!

Kind regards,

Lee
 
Back
Top