There must be another factor at work.
This code works in Access 2003 even when the database window begins hidden:
DoCmd.SelectObject acForm, "Form1", True

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
Along with the SelectObject action, I also have also an Echo, and a Close
action in the same macro that closes Form1. Is that the factor you mean? How
could I fix it if that's what causes the problem?
Thanks
Sam
> There must be another factor at work.
>
[quoted text clipped - 13 lines]
> > Object Type: Form
> > Object Name: form1
Allen Browne - 19 Aug 2004 06:54 GMT
Hi Sam
We can't see your macro, or the order of actions there. To test if they are
affecting the macro, you could disable them by typing:
0
into the Condition column in macro design. (Go to the View menu if you do
not see a Condition column.)
Another way to test would be to open the Immediate Window (Ctrl+G), and
enter:
DoCmd.SelectObject acForm, , True
If that still does not work, are you able to show the database window by
pressing F11?

Signature
Allen Browne - Microsoft MVP. Perth, Western Australia.
Tips for Access users - http://allenbrowne.com/tips.html
Reply to group, rather than allenbrowne at mvps dot org.
> Along with the SelectObject action, I also have also an Echo, and a Close
> action in the same macro that closes Form1. Is that the factor you mean?
[quoted text clipped - 23 lines]
>> > Object Type: Form
>> > Object Name: form1
Van T. Dinh - 21 Aug 2004 11:56 GMT
In your SelectObject Macro action, make sure you set the "In Database
Window" argument to Yes / True.
I am not sure about the Echo Macro action you described. Normally, you
would use a pair of Echo actions, one to turn it off and another to turn it
back on.
--
HTH
Van T. Dinh
MVP (Access)
> Along with the SelectObject action, I also have also an Echo, and a Close
> action in the same macro that closes Form1. Is that the factor you mean? How
> could I fix it if that's what causes the problem?
>
> Thanks
> Sam
Sam Kuo - 23 Sep 2004 05:43 GMT
Thanks! Allen and Van.
The problem is that the "In Database Window" argument was set to No. Now it
works just fine.
Much appreciated!
Sam