Too Many Forms

D

DS

Is there a way to use the same form over again. I've benn making a new
pop-up form for every Main form I have....the problem is whenever the
Pop-Up comes up the Main form goes invisible and when the Pop-Up closes
the Main form reappears. Can I use the Dim Statement for this so that I
can use the same Pop-Up form over and over again? How would it work?
Thanks
DS
 
R

Rob Oldfield

To answer your first question: yes, there is. But you'd need to post more
detail for anyone to figure out what you're after. Pop-up form in what two
situations?
 
L

Larry Linson

Is the design of your pop-up forms identical? If it is, then you should be
able to use the same pop-up form with different main forms. Unless you need
to have multiple copies of the pop-up open at the same time, you should just
be able to use DoCmd.OpenForm to open it... from whichever main form you
happen to be on.

Larry Linson
Microsoft Access MVP
 
D

DS

Larry said:
Is the design of your pop-up forms identical? If it is, then you should be
able to use the same pop-up form with different main forms. Unless you need
to have multiple copies of the pop-up open at the same time, you should just
be able to use DoCmd.OpenForm to open it... from whichever main form you
happen to be on.

Larry Linson
Microsoft Access MVP
I know I can use it over and over agaib to open it but the problem is
closing it. When I hit OK I have to say that the main form becomes
visable again, everytime though the main form will be different, can I
use the dim statement for this?
Thanks
DS
 
J

John Spencer

Can you use the OpenArgs to pass the pop-up form the name of the "calling"
form? Then you could use that form name to specify which form you want to
make visible, open, etc when you close the pop-up.
 
D

DS

John said:
Can you use the OpenArgs to pass the pop-up form the name of the "calling"
form? Then you could use that form name to specify which form you want to
make visible, open, etc when you close the pop-up.





Sounds good, but how would I do This?
Thanks
DS
 
J

John Spencer

Are you calling the form through code?
Me.Name would get the name of the form if you were calling from a button on
a form.

DoCmd.OpenForm "PopUpForm", , , , , , Me.Name

Alternatively
DoCmd.OpenForm "PopUpForm", , , , , , "MyWondrousForm"

In the close event of the Popup Form

DoCmd.OpenForm Me.OpenArgs
or
Forms(Me.OpenArgs).Visible = True
 
D

DS

John said:
Are you calling the form through code?
Me.Name would get the name of the form if you were calling from a button on
a form.

DoCmd.OpenForm "PopUpForm", , , , , , Me.Name

Alternatively
DoCmd.OpenForm "PopUpForm", , , , , , "MyWondrousForm"

In the close event of the Popup Form

DoCmd.OpenForm Me.OpenArgs
or
Forms(Me.OpenArgs).Visible = True
Thanks, I'll give it a try.
DS
 
Top