> Hi,
>
> I want to be able to close 1 form and open another form that displays
> the result of the first form, but I have no idea how to do it! I
> tried various options in VB but with no joy.
DoCmd.Close acForm, "FormName"
DoCmd.OpenForm "OtherFormName"

Signature
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com
Steve - 11 Mar 2005 11:41 GMT
Rick:
But if this code is part of "FormName" (the 1st form), would the 2nd
line to open "OtherFormName" still be run?
Steve
>>Hi,
>>
[quoted text clipped - 4 lines]
> DoCmd.Close acForm, "FormName"
> DoCmd.OpenForm "OtherFormName"
Rick Brandt - 11 Mar 2005 12:46 GMT
> Rick:
> But if this code is part of "FormName" (the 1st form), would the 2nd
> line to open "OtherFormName" still be run?
Yep. The code in a form will continue executing to the end even if the very
first line is to close the form containing the code. This would not be true for
code like the following...
Sub TestSub
some code...
DoCmd.Quit
some more code...
End Sub
In the above the Quit command will definitely prevent any further lines from
executing because Access itself is being closed. A form or report however does
not have this problem from being closed.

Signature
I don't check the Email account attached
to this message. Send instead to...
RBrandt at Hunter dot com