minimize two forms within the same procedure

R

Ra

Hi,

I have two forms that I would like to minimize at the same time.
One is called “Area IPPMâ€, and the other one is called “Area CSPC Tag Summaryâ€

I open first “Area IPPMâ€, double click on a specific record, that opens the
second form “Area CSPC Tag Summaryâ€. On the second form I have a button that
I click to open the report “Area Scrap Tag Summaryâ€.

When I click the button, with the current procedure I minimize the form
“Area CSPC Tag Summaryâ€, and close the form “Area IPPMâ€.

When I try to print the report I get an error message, because the first
form “Area IPPMâ€, is closed.

Any way I can minimize this form instead of closing it?


Private Sub Command18_Click()
On Error GoTo Err_Command18_Click

Dim stDocName As String

stDocName = "Area Scrap Tag Summary"

DoCmd.Minimize
DoCmd.OpenReport stDocName, acPreview
'DoCmd.Close acForm, "Area IPPM"

Exit_Command18_Click:
Exit Sub

Err_Command18_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command18_Click

End Sub

Any advice would be appreciated.

Thank you,
 
M

Marshall Barton

Ra said:
I have two forms that I would like to minimize at the same time.
One is called “Area IPPM”, and the other one is called “Area CSPC Tag Summary”

I open first “Area IPPM”, double click on a specific record, that opens the
second form “Area CSPC Tag Summary”. On the second form I have a button that
I click to open the report “Area Scrap Tag Summary”.

When I click the button, with the current procedure I minimize the form
“Area CSPC Tag Summary”, and close the form “Area IPPM”.

When I try to print the report I get an error message, because the first
form “Area IPPM”, is closed.

Any way I can minimize this form instead of closing it?


Private Sub Command18_Click()
On Error GoTo Err_Command18_Click

Dim stDocName As String

stDocName = "Area Scrap Tag Summary"

DoCmd.Minimize
DoCmd.OpenReport stDocName, acPreview
'DoCmd.Close acForm, "Area IPPM"

Exit_Command18_Click:
Exit Sub

Err_Command18_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Command18_Click

End Sub


It's better to make the forms invisible.

If you open the report in Dialog mode, then you can close or
make the forms visible right after the OpenReport line.
 
R

Ra

thank you for the advice..it worked !!!

Marshall Barton said:
It's better to make the forms invisible.

If you open the report in Dialog mode, then you can close or
make the forms visible right after the OpenReport line.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top