DoCmd.Close

G

Guest

I use this form to set the criteria for a Query that feed a report. I would
like to close this form after the report is open. I added the follwing and it
did not work:

Form name is: Qtr Loss LookUp FM

Dim stDocName1 As String
stDocName = "Qtr Loss LookUp FM"
DoCmd.Close stDocName1, nosave

and it did not work. any help would be great.

Keith

Private Sub Command21_Click()
On Error GoTo Err_Command21_Click

Dim stDocName As String

stDocName = "DEP Loss Qtr Rpt"

DoCmd.OpenReport stDocName, acPreview

Exit_Command21_Click:
Exit Sub

Err_Command21_Click:
MsgBox Err.Description
Resume Exit_Command21_Click

End Sub
 

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