close first form

R

rob peterson

I have an OK button on one form that on click does:

Private Sub previewreportsbutton_Click()
previewrpt acNormal
End Sub

takes me to another form to select a range for a sub previewrpt - one of an
option group.

HOW do I close the original form (previewreportsbutton)? It stays on the
screen and I have to maually close it.

thanks.
 
D

Dirk Goldgar

rob peterson said:
I have an OK button on one form that on click does:

Private Sub previewreportsbutton_Click()
previewrpt acNormal
End Sub

takes me to another form to select a range for a sub previewrpt - one
of an option group.

HOW do I close the original form (previewreportsbutton)? It stays on
the screen and I have to maually close it.

thanks.

The simplest way is to close it in the same procedure that calls
previewrpt, like this:

Private Sub previewreportsbutton_Click()
previewrpt acNormal
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub
 
R

rob peterson

Thanks Dirk.
rob

Dirk Goldgar said:
The simplest way is to close it in the same procedure that calls
previewrpt, like this:

Private Sub previewreportsbutton_Click()
previewrpt acNormal
DoCmd.Close acForm, Me.Name, acSaveNo
End Sub

--
Dirk Goldgar, MS Access MVP
www.datagnostics.com

(please reply to the newsgroup)
 

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