View Single Post
  #3  
Old February 24th, 2006, 07:45 AM posted to microsoft.public.access.gettingstarted
external usenet poster
 
Posts: n/a
Default Opening new form and closing the present one?

Put

DoCmd.Close

into the OnClick event of your new command button.

HTH
--
-Larry-
--

"elli" wrote in message
...
Good morning!
I made a form with command button that opens a new form. Can I put a

piece
of code to close the first form in this code too? If so what piece

of code
and where exactly to put it?

-elli-

Private Sub Command8_Click()
On Error GoTo Err_Command8_Click

Dim stDocName As String
Dim stLinkCriteria As String

stDocName = "Frm1"
DoCmd.OpenForm stDocName, , , stLinkCriteria

Exit_Command8_Click:
Exit Sub

Err_Command8_Click:
MsgBox Err.Description
Resume Exit_Command8_Click

End Sub