DoCmd.Close

  • Thread starter Thread starter Ana
  • Start date Start date
A

Ana

Hi,
I use a dialog form to bring up a report and I'd like to close the form
automatically once the report is brought up.
The below code doesn't work. What's the solution?
TIA

Private Sub Comman2_Click()
DoCmd.OpenReport "Test", acViewPreview
DoCmd.Close
End Sub
 
You probably need to specify what you want to close:

DoCmd.Close acForm, Me.Name
 
Or you could try to put 'DoCmd.Close'
at the first line if you won't to specify the objects name.
 

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

Back
Top