close first form

  • Thread starter Thread starter rob peterson
  • Start date Start date
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.
 
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
 
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)
 
Back
Top