Reusable form?

  • Thread starter Thread starter Curt
  • Start date Start date
C

Curt

I have form (frmEmail) that I want to use with several
froms. This form is opened by pressing email on any of
these forms. On it, it has a button (Individual), a
combobox with a list of selections, and a close button.
Instead of creating several of these I would like to be
able to use it on these several forms. First is this
possible? Second, if so how do I go about doing it?

I imagine that when this form is opened the previous form
is hidden. Then a selection is made. Then the email
macro is ran and then the email form closes and the
previous form is visible. How do you make the previous
form visible as a variable?

Also, if individual is selected I want the a report ran on
that individual. However, since I want to use this form
for several forms how do I do this? Like I said I don't
want to make several forms for the same function.

Tnaks for any advice.
 
To show the previous form again, pass in its name in (say) the OpenArgs:

DoCmd.OpenForm "frmEmail", OpenArgs:=Me.Name

Then in the Close event of the email form:
If Len(Me.OpenArgs) > 0 Then
Forms(Me.OpenArgs).Visible = True
End If
 
Back
Top