Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem closing a form 1

Status
Not open for further replies.

merlynsdad

Programmer
Nov 18, 2010
175
US
I have a number of forms in the db, all of which open another form, then close themselves. The code
Code:
DoCmd.OpenForm "frmA"
        DoCmd.Close acForm, "frmB"
is in a button on each form. I have one form, however, where I want the exact same action, but from the form close event instead of a button. So I put this same code in the close form event, but when I click on the X to close the form I'm getting a 2501 error that "the close action was cancelled." Is there something different about the close form event that is causing this or what?

If the square peg won't fit in the round hole, sand off the corners.
 
Why do you want to close a form when it is closing ????

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
What I'm trying to do is have it bring up another form when it closes. I've tried the same code in unload form with the same result.

If the square peg won't fit in the round hole, sand off the corners.
 
I cheated and just put a button on it to return to the other form. But I am interested in why it wouldn't work the way I thought it should.

If the square peg won't fit in the round hole, sand off the corners.
 
have it bring up another form when it closes
So, open the another form but don't close the current form (as it is already closing)

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
That makes sense. Thanks.

If the square peg won't fit in the round hole, sand off the corners.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top