Run a procedure from a second form

imperator

Archaeologist etc.
Local time
Today, 23:41
Joined
Feb 28, 2004
Messages
38
Hi All

I have a form (lets call it "form 1") on which are two buttons, one will print a letter, the other will send an email, you choose which to press depending on preference. The content of the email and letter comes from form 1. This all works fine.

I would like to simplify the look of the form by having only one button on form 1 called 'send confirmation' which then opens a second small form ("form 2") on which there is a two button toggle option group, one for email and one for letter. I would like to be able to press one of these buttons and run the procedure for either the email or letter.

This is were my knowledge fails me. How do I reference the data in form 1 from form 2 so the email and letter procedures have the data they need?

Further to this, would it be better to have the email and letter sub procedures in their own module instead of in the click event on the form? There may be scope to have other forms sending confirmation notices.

I would be open to suggestions for a more elegant solution if you feel this is convoluted.

Thanks,
Ray
 
Last edited:
Thanks for that John, that page has helped me in the past.

Just to clarify, form 2 is not a subform. It's just a small popup type form to ask you which method of response you want. My limited abilities suggest to me the answer lies with passing arguments, but maybe I'm wrong.
Ray
 
Perhaps you could use the OpenArg portion of your DoCmd.OpenForm to let Form 2 know how to behave.

There is some sample code here that might give you some ideas.
 
Thanks John. Problem solved, it wasn't nearly so complicated as I thought it was.
 

Users who are viewing this thread

Back
Top Bottom