Hi!
You get this error message when you stop the form from opening either programmatically or manually. This often occurrs when a programmer checks to be sure that there are records in the recordset of the form and then closes the form if there isn't. Assuming the second form is opening the way you want it to, including automatically closing when it should, then trap for the error in the code behind your button like this:
OnError Go To Err_Handler
docmd.openform "formname",acnormal
Err_Handler
If Err.Number = 2701 (I think this is the right number, but just let the error happen and get the number there) Then
Resume Next
Else
Call MsgBox(Err.Number & ": " & Err.Description)
End If
This will exit the Sub when the error is the one you are getting and still allow other errors to be displayed to the user.
hth
Jeff Bridgham
bridgham@purdue.edu