minimize form

R

Ra

Hi,
I have a form where I set up the “Pop Up†property to “Yes†and the “Modalâ€
property to “Noâ€.

I have a button that opens a report. When I open the report I want to
minimize the form (not close), and see only the report.

I wrote the following statement:

“Private Sub Print_Contribution_Click()
On Error GoTo Err_Print_Contribution_Click

Dim stDocName As String

stDocName = "IPPM Top Ten Contribution"
DoCmd.OpenReport stDocName, acPreview
DoCmd.Minimize acForm, "CSPC IPPM Contribution"


Exit_Print_Contribution_Click:
Exit Sub

Err_Print_Contribution_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Print_Contribution_Click

End Sub.â€

When I Debug I get the following statement:

“Wrong number of arguments or invalid property assignmentâ€

Please advice.

Thank you,
 
B

Beetle

The Minimize method doesn't have any arguments, which is why you are
getting the error. Just call the minimize before you open the report;

Private Sub Print_Contribution_Click()
On Error GoTo Err_Print_Contribution_Click

Dim stDocName As String

stDocName = "IPPM Top Ten Contribution"

DoCmd.Minimize
DoCmd.OpenReport stDocName, acPreview


Exit_Print_Contribution_Click:
Exit Sub

Err_Print_Contribution_Click:
MsgBox Err.DESCRIPTION
Resume Exit_Print_Contribution_Click

End Sub.

Another option would be to hide the form with;

Me.Visible = False

But you would need code in the close event of the report to make it
visible again.
 

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