View Full Version : Button to open one form and close other


not_rich_yet
03-30-2002, 01:34 PM
Hi,

I can get a button to open a form and get a button to close a form.

Thing is, I want the button to open one form and close itself...if that makes sense?

eg form1 has a button on it.
When clicked, I want to open form2 and close form1

I've tried using the forms LostFocus property and also tried putting the close form code in for the button all to no avail...

Any suggestions?

Cheers,

nry

Rich
03-30-2002, 02:14 PM
DoCmd. OpenForm,"Form2
DoCmd.Close "Form1"

not_rich_yet
04-01-2002, 10:40 AM
Didn't work for me....the new form loaded but the original form didn't close...possibly because it lost focus?

Anyhow, after a bit of searching I used the 'IsOpen' function from the Northwind Database.....

nry

expublish
04-02-2002, 07:10 AM
I know there is no error handling, but in this case I would use a simple macro. Macro's rule!

Scott
(At work, but very, very bored ....)

Rich
04-02-2002, 09:15 AM
Since your bored, why not convert your macros to vba include error handling and avoid the Blue Screen Kiss Of Death?